2019-10-15 20:40:23 +02:00
|
|
|
import { Todos, Projects, UserStore, CalendarStore, GlobalStore } from '@store'
|
2019-03-13 01:53:53 +01:00
|
|
|
import globalroutines from './../../globalroutines/index'
|
|
|
|
|
import { costanti } from './costanti'
|
2019-07-12 14:09:44 +02:00
|
|
|
import { toolsext } from './toolsext'
|
2019-04-05 23:59:52 +02:00
|
|
|
import { translation } from './translation'
|
2019-10-12 23:34:58 +02:00
|
|
|
import Quasar, { colors, date, Screen } from 'quasar'
|
2019-11-04 20:29:35 +01:00
|
|
|
import { scroll } from 'quasar'
|
2019-11-08 21:35:47 +01:00
|
|
|
|
2020-01-27 15:09:11 +01:00
|
|
|
import { copyToClipboard } from 'quasar'
|
|
|
|
|
|
2019-11-04 20:29:35 +01:00
|
|
|
const { getScrollTarget, setScrollPosition } = scroll
|
|
|
|
|
|
2019-10-12 23:34:58 +02:00
|
|
|
import {
|
|
|
|
|
IBookedEvent,
|
|
|
|
|
ICollaborations,
|
|
|
|
|
IEvents,
|
|
|
|
|
IListRoutes,
|
|
|
|
|
IMenuList,
|
|
|
|
|
IParamDialog,
|
|
|
|
|
IProject,
|
|
|
|
|
ITodo,
|
|
|
|
|
Privacy
|
|
|
|
|
} from '@src/model'
|
2019-03-22 20:51:42 +01:00
|
|
|
import * as ApiTables from '@src/store/Modules/ApiTables'
|
2019-04-05 23:59:52 +02:00
|
|
|
import translate from '@src/globalroutines/util'
|
2019-04-29 02:47:53 +02:00
|
|
|
import { RouteNames } from '@src/router/route-names'
|
2019-02-27 02:58:41 +01:00
|
|
|
|
2019-04-29 23:47:42 +02:00
|
|
|
import { lists } from './lists'
|
2019-12-27 12:43:42 +01:00
|
|
|
import { preloadedimages, static_data } from '@src/db/static_data'
|
2019-09-12 16:19:23 +02:00
|
|
|
import { IColl, ITimeLineEntry, ITimeLineMain } from '@src/model/GlobalStore'
|
2019-10-10 16:53:33 +02:00
|
|
|
import { func_tools } from '@src/store/Modules/toolsext'
|
2019-10-11 21:40:47 +02:00
|
|
|
import { serv_constants } from '@src/store/Modules/serv_constants'
|
2019-10-14 20:32:15 +02:00
|
|
|
import { shared_consts } from '@src/common/shared_vuejs'
|
2019-04-29 23:47:42 +02:00
|
|
|
|
2019-10-26 02:21:14 +02:00
|
|
|
import { dom } from 'quasar'
|
2019-10-27 00:37:00 +02:00
|
|
|
|
2020-02-07 22:08:01 +01:00
|
|
|
const printf = require('util').format
|
2020-02-02 04:07:24 +01:00
|
|
|
|
2019-10-26 02:21:14 +02:00
|
|
|
const { height, width } = dom
|
|
|
|
|
|
2019-11-01 15:52:58 +01:00
|
|
|
import Cookies from 'js-cookie'
|
2020-02-07 22:08:01 +01:00
|
|
|
import { forEachComment } from 'tslint'
|
2020-05-10 21:06:42 +02:00
|
|
|
import messages from '@src/statics/i18n'
|
2019-11-01 15:52:58 +01:00
|
|
|
|
|
|
|
|
const TokenKey = 'Admin-Token'
|
|
|
|
|
|
2019-03-13 13:40:17 +01:00
|
|
|
export interface INotify {
|
|
|
|
|
color?: string | 'primary'
|
|
|
|
|
textColor?: string
|
|
|
|
|
icon?: string | ''
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-27 02:58:41 +01:00
|
|
|
export const tools = {
|
2019-11-01 15:52:58 +01:00
|
|
|
CAN_EDIT: 'q-ce',
|
2020-05-10 21:06:42 +02:00
|
|
|
TABBED_DASHBOARD: 't-db',
|
2020-05-14 17:23:03 +02:00
|
|
|
TABBED_HOME: 't-home',
|
2020-05-11 22:43:54 +02:00
|
|
|
TABBED_NAVE: 't-nave',
|
2019-11-01 15:52:58 +01:00
|
|
|
|
2020-03-10 21:42:30 +01:00
|
|
|
getprefCountries: ['it', 'si', 'us', 'es', 'pt', 'uk', 'fr', 'de', 'ch', 'br', 'sk'],
|
2019-12-29 23:29:56 +01:00
|
|
|
|
2020-01-13 23:53:27 +01:00
|
|
|
APORTADOR_NONE: '------',
|
|
|
|
|
|
2020-07-04 10:54:05 +02:00
|
|
|
TYPECONF_ZOOM: 'zoom',
|
|
|
|
|
TYPECONF_JITSI: 'jitsi',
|
|
|
|
|
|
2019-12-29 01:54:00 +01:00
|
|
|
APORTADOR_SOLIDARIO: 'apsol',
|
|
|
|
|
|
2020-05-10 21:06:42 +02:00
|
|
|
IDAPP_AYNI: '7',
|
|
|
|
|
IDAPP_SIP: '9',
|
|
|
|
|
|
2020-03-10 21:42:30 +01:00
|
|
|
TipoMsg: {
|
|
|
|
|
SEND_LINK_CHAT_DONATORI: 1,
|
2020-03-25 09:26:08 +01:00
|
|
|
SEND_MSG: 2,
|
2020-06-08 13:31:44 +02:00
|
|
|
SEND_MSG_SINGOLO: 3,
|
|
|
|
|
SEND_TO_ALL: 10,
|
|
|
|
|
SEND_MSG_EFFETTUA_IL_DONO: 1000,
|
|
|
|
|
SEND_MSG_SOLLECITO_DONATORI_NO_DONO: 1005,
|
|
|
|
|
SEND_MSG_A_MEDIATORI: 1010,
|
|
|
|
|
SEND_MSG_A_SOGNATORE: 1020,
|
|
|
|
|
SEND_MSG_A_UTENTE_SOSTITUITO: 1030,
|
|
|
|
|
SEND_MSG_DONO_RICEVUTO_CORRETTAMENTE: 1040,
|
2020-03-10 21:42:30 +01:00
|
|
|
},
|
|
|
|
|
|
2019-10-28 19:00:06 +01:00
|
|
|
listBestColor: [
|
|
|
|
|
'blue',
|
|
|
|
|
'green',
|
|
|
|
|
'purple',
|
|
|
|
|
'deep-purple',
|
|
|
|
|
'indigo',
|
|
|
|
|
'light-blue',
|
|
|
|
|
'cyan',
|
|
|
|
|
'teal',
|
|
|
|
|
'lime',
|
|
|
|
|
'orange',
|
|
|
|
|
'deeporange',
|
|
|
|
|
'grey',
|
|
|
|
|
'blue-gray',
|
|
|
|
|
'yellow'
|
|
|
|
|
],
|
|
|
|
|
|
2020-02-02 04:07:24 +01:00
|
|
|
TABUSER: 'users',
|
2020-03-21 10:33:10 +01:00
|
|
|
TABNAVI: 'navi',
|
2020-05-10 21:06:42 +02:00
|
|
|
TABLISTAINGRESSO: 'listaingressos',
|
2020-05-19 00:18:55 +02:00
|
|
|
TABGRADUATORIA: 'graduatorias',
|
2019-10-24 23:30:18 +02:00
|
|
|
TABEVENTS: 'myevents',
|
2020-02-02 04:07:24 +01:00
|
|
|
TABEXTRALIST: 'extralist',
|
2019-11-21 00:19:42 +01:00
|
|
|
TABNEWSLETTER: 'newstosent',
|
2019-12-27 12:43:42 +01:00
|
|
|
TABGALLERY: 'gallery',
|
2019-11-21 00:19:42 +01:00
|
|
|
TABMAILINGLIST: 'mailinglist',
|
2019-12-07 00:20:55 +01:00
|
|
|
TABMYPAGE: 'mypage',
|
2020-01-21 01:38:28 +01:00
|
|
|
TABCALZOOM: 'calzoom',
|
2019-12-04 02:04:54 +01:00
|
|
|
TABTEMPLEMAIL: 'templemail',
|
|
|
|
|
TABOPZEMAIL: 'opzemail',
|
2019-10-24 23:30:18 +02:00
|
|
|
|
2019-10-20 01:22:38 +02:00
|
|
|
MAX_CHARACTERS: 60,
|
2019-04-29 01:01:31 +02:00
|
|
|
projects: 'projects',
|
|
|
|
|
todos: 'todos',
|
2019-02-06 18:47:54 +01:00
|
|
|
EMPTY: 0,
|
2018-11-17 20:32:28 +01:00
|
|
|
CALLING: 10,
|
|
|
|
|
OK: 20,
|
|
|
|
|
ERR_GENERICO: -1,
|
2019-02-06 18:47:54 +01:00
|
|
|
ERR_SERVERFETCH: -2,
|
|
|
|
|
ERR_AUTHENTICATION: -5,
|
2019-01-05 20:11:41 +01:00
|
|
|
|
2019-10-20 22:44:18 +02:00
|
|
|
NOFIELD: 'nofield',
|
|
|
|
|
|
2019-09-12 16:19:23 +02:00
|
|
|
TYPE_AUDIO: 1,
|
|
|
|
|
|
2019-04-02 00:18:01 +02:00
|
|
|
NUMSEC_CHECKUPDATE: 20000,
|
|
|
|
|
|
2019-04-06 21:02:33 +02:00
|
|
|
FIRST_PROJ: '5ca8f17fcd40dc5012f53346',
|
2019-03-28 12:58:34 +01:00
|
|
|
|
2019-04-25 00:30:13 +02:00
|
|
|
WHAT_NOTHING: 0,
|
2019-04-03 02:48:05 +02:00
|
|
|
WHAT_TODO: 1,
|
|
|
|
|
WHAT_PROJECT: 2,
|
|
|
|
|
|
2019-07-12 18:23:16 +02:00
|
|
|
languageid: 5,
|
|
|
|
|
|
2019-02-22 10:23:00 +01:00
|
|
|
SERVKEY_VERS: 'vers',
|
|
|
|
|
|
2019-01-05 20:11:41 +01:00
|
|
|
localStorage: {
|
2020-01-27 15:09:11 +01:00
|
|
|
teleg_id: 'ti',
|
2019-02-09 18:04:49 +01:00
|
|
|
verified_email: 'vf',
|
2019-12-31 00:44:43 +01:00
|
|
|
made_gift: 'mg',
|
2019-02-13 18:48:30 +01:00
|
|
|
wasAlreadySubOnDb: 'sb',
|
2019-01-30 01:05:31 +01:00
|
|
|
categorySel: 'cs',
|
2019-01-05 20:11:41 +01:00
|
|
|
isLogged: 'ilog',
|
|
|
|
|
expirationDate: 'expdate',
|
|
|
|
|
leftDrawerOpen: 'ldo',
|
|
|
|
|
userId: 'uid',
|
|
|
|
|
token: 'tk',
|
2019-02-16 02:01:17 +01:00
|
|
|
username: 'uname',
|
2019-10-10 16:53:33 +02:00
|
|
|
name: 'nm',
|
|
|
|
|
surname: 'sn',
|
2019-10-14 20:32:15 +02:00
|
|
|
perm: 'pm',
|
2019-10-25 19:07:56 +02:00
|
|
|
lang: 'lg',
|
|
|
|
|
img: 'img'
|
2019-01-14 22:40:30 +01:00
|
|
|
},
|
|
|
|
|
|
2019-03-22 18:49:38 +01:00
|
|
|
Priority: {
|
2019-01-27 19:09:48 +01:00
|
|
|
PRIORITY_HIGH: 2,
|
|
|
|
|
PRIORITY_NORMAL: 1,
|
|
|
|
|
PRIORITY_LOW: 0
|
|
|
|
|
},
|
|
|
|
|
|
2019-04-02 00:18:01 +02:00
|
|
|
Status: {
|
|
|
|
|
NONE: 0,
|
|
|
|
|
OPENED: 1,
|
2019-04-05 23:59:52 +02:00
|
|
|
COMPLETED: 10
|
2019-04-02 00:18:01 +02:00
|
|
|
},
|
|
|
|
|
|
2019-10-28 16:00:37 +01:00
|
|
|
FieldType: {
|
|
|
|
|
boolean: 1,
|
|
|
|
|
date: 2,
|
|
|
|
|
string: 4,
|
2019-11-01 15:52:58 +01:00
|
|
|
binary: 8,
|
2019-11-04 20:29:35 +01:00
|
|
|
html: 16,
|
|
|
|
|
select: 32,
|
|
|
|
|
number: 64,
|
|
|
|
|
typeinrec: 128,
|
2019-11-12 21:33:18 +01:00
|
|
|
multiselect: 256,
|
2019-12-04 02:04:54 +01:00
|
|
|
password: 512,
|
2019-12-27 12:43:42 +01:00
|
|
|
listimages: 1024,
|
2019-12-29 01:54:00 +01:00
|
|
|
image: 2048,
|
2019-12-29 23:29:56 +01:00
|
|
|
nationality: 4096,
|
|
|
|
|
intcode: 5000,
|
2020-02-02 04:07:24 +01:00
|
|
|
multioption: 6000
|
2019-10-28 16:00:37 +01:00
|
|
|
},
|
|
|
|
|
|
2019-11-04 20:29:35 +01:00
|
|
|
FieldTypeArr: [
|
|
|
|
|
{ label: 'Boolean', value: 1 },
|
|
|
|
|
{ label: 'Date', value: 2 },
|
|
|
|
|
{ label: 'String', value: 4 },
|
|
|
|
|
{ label: 'Binary', value: 8 },
|
|
|
|
|
{ label: 'Html', value: 16 },
|
|
|
|
|
{ label: 'Select', value: 32 },
|
|
|
|
|
{ label: 'Number', value: 64 }
|
|
|
|
|
],
|
|
|
|
|
|
2019-10-10 16:53:33 +02:00
|
|
|
SelectListNumPeople: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
label: '1',
|
|
|
|
|
value: 1
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
label: '2',
|
|
|
|
|
value: 2
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
label: '3',
|
|
|
|
|
value: 3
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 4,
|
|
|
|
|
label: '4',
|
|
|
|
|
value: 4
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 5,
|
|
|
|
|
label: '5',
|
|
|
|
|
value: 5
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
,
|
|
|
|
|
|
2019-04-05 23:59:52 +02:00
|
|
|
selectPhase: {
|
2019-04-05 16:16:29 +02:00
|
|
|
it: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: translation.it.fase + ' 0',
|
|
|
|
|
value: 0
|
2019-04-05 16:16:29 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: translation.it.fase + ' 1',
|
|
|
|
|
value: 1
|
2019-04-05 16:16:29 +02:00
|
|
|
},
|
|
|
|
|
{
|
2019-04-05 23:59:52 +02:00
|
|
|
id: 3,
|
|
|
|
|
label: translation.it.fase + ' 2',
|
|
|
|
|
value: 2
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 4,
|
|
|
|
|
label: translation.it.fase + ' 3',
|
|
|
|
|
value: 3
|
2019-04-05 16:16:29 +02:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
es: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: translation.es.fase + ' 0',
|
|
|
|
|
value: 0
|
2019-04-05 16:16:29 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: translation.es.fase + ' 1',
|
|
|
|
|
value: 1
|
2019-04-05 16:16:29 +02:00
|
|
|
},
|
|
|
|
|
{
|
2019-04-05 23:59:52 +02:00
|
|
|
id: 3,
|
|
|
|
|
label: translation.es.fase + ' 2',
|
|
|
|
|
value: 2
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 4,
|
|
|
|
|
label: translation.es.fase + ' 3',
|
|
|
|
|
value: 3
|
2019-04-05 16:16:29 +02:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
enUs: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: translation.enUs.fase + ' 0',
|
|
|
|
|
value: 0
|
2019-04-05 16:16:29 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: translation.enUs.fase + ' 1',
|
|
|
|
|
value: 1
|
2019-04-05 16:16:29 +02:00
|
|
|
},
|
|
|
|
|
{
|
2019-04-05 23:59:52 +02:00
|
|
|
id: 3,
|
|
|
|
|
label: translation.enUs.fase + ' 2',
|
|
|
|
|
value: 2
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 4,
|
|
|
|
|
label: translation.enUs.fase + ' 3',
|
|
|
|
|
value: 3
|
2019-04-05 16:16:29 +02:00
|
|
|
}
|
|
|
|
|
]
|
2019-04-09 21:07:16 +02:00
|
|
|
},
|
2019-01-14 22:40:30 +01:00
|
|
|
|
2019-04-09 21:07:16 +02:00
|
|
|
selectPrivacy: {
|
|
|
|
|
it: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
label: translation.it.privacy.all,
|
|
|
|
|
value: Privacy.all
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
label: translation.it.privacy.friends,
|
|
|
|
|
value: Privacy.friends
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
label: translation.it.privacy.mygroup,
|
|
|
|
|
value: Privacy.mygroup
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 4,
|
|
|
|
|
label: translation.it.privacy.onlyme,
|
|
|
|
|
value: Privacy.onlyme
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
es: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
label: translation.es.privacy.all,
|
|
|
|
|
value: Privacy.all
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
label: translation.es.privacy.friends,
|
|
|
|
|
value: Privacy.friends
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
label: translation.es.privacy.mygroup,
|
|
|
|
|
value: Privacy.mygroup
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 4,
|
|
|
|
|
label: translation.es.privacy.onlyme,
|
|
|
|
|
value: Privacy.onlyme
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
enUs: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
label: translation.enUs.privacy.all,
|
|
|
|
|
value: Privacy.all
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
label: translation.enUs.privacy.friends,
|
|
|
|
|
value: Privacy.friends
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
label: translation.enUs.privacy.mygroup,
|
|
|
|
|
value: Privacy.mygroup
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 4,
|
|
|
|
|
label: translation.enUs.privacy.onlyme,
|
|
|
|
|
value: Privacy.onlyme
|
|
|
|
|
}
|
|
|
|
|
]
|
2019-04-05 16:16:29 +02:00
|
|
|
},
|
2019-04-09 21:07:16 +02:00
|
|
|
|
2019-04-05 23:59:52 +02:00
|
|
|
selectStatus: {
|
2019-03-13 01:53:53 +01:00
|
|
|
it: [
|
2019-01-14 22:40:30 +01:00
|
|
|
{
|
2019-01-16 02:26:43 +01:00
|
|
|
id: 1,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Nessuno',
|
|
|
|
|
value: 0, // Status.NONE
|
2019-01-16 02:26:43 +01:00
|
|
|
icon: 'expand_less'
|
2019-01-14 22:40:30 +01:00
|
|
|
},
|
|
|
|
|
{
|
2019-01-16 02:26:43 +01:00
|
|
|
id: 2,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Aperto',
|
|
|
|
|
value: 1, // Status.OPENED
|
2019-02-16 02:01:17 +01:00
|
|
|
icon: 'expand_less'
|
|
|
|
|
},
|
|
|
|
|
{
|
2019-04-07 21:24:10 +02:00
|
|
|
id: 3,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Completato',
|
|
|
|
|
value: 10, // Status.COMPLETED
|
2019-02-16 02:01:17 +01:00
|
|
|
icon: 'expand_less'
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
es:
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
label: 'Ninguno',
|
|
|
|
|
value: 0, // Status.NONE
|
|
|
|
|
icon: 'expand_less'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
label: 'Abierto',
|
|
|
|
|
value: 1, // Status.OPENED
|
|
|
|
|
icon: 'expand_less'
|
|
|
|
|
},
|
|
|
|
|
{
|
2019-04-07 21:24:10 +02:00
|
|
|
id: 3,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Completado',
|
|
|
|
|
value: 10, // Status.COMPLETED
|
|
|
|
|
icon: 'expand_less'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
enUs:
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
label: 'None',
|
|
|
|
|
value: 0, // Status.NONE
|
|
|
|
|
icon: 'expand_less'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
label: 'Opened',
|
|
|
|
|
value: 1, // Status.OPENED
|
|
|
|
|
icon: 'expand_less'
|
|
|
|
|
},
|
|
|
|
|
{
|
2019-04-07 21:24:10 +02:00
|
|
|
id: 3,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Completed',
|
|
|
|
|
value: 10, // Status.COMPLETED
|
|
|
|
|
icon: 'expand_less'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
,
|
2019-01-27 19:09:48 +01:00
|
|
|
|
2019-02-15 01:25:44 +01:00
|
|
|
INDEX_MENU_DELETE: 4,
|
2019-01-29 03:12:18 +01:00
|
|
|
|
2019-04-05 23:59:52 +02:00
|
|
|
menuPopupTodo:
|
|
|
|
|
{
|
|
|
|
|
it: [
|
2019-04-29 01:01:31 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: 'Taglia',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.CUT,
|
2019-04-29 01:01:31 +02:00
|
|
|
icon: 'undo'
|
|
|
|
|
},
|
2019-04-05 23:59:52 +02:00
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-07-10 11:37:00 +02:00
|
|
|
label: 'Modifica',
|
|
|
|
|
value: lists.MenuAction.EDIT,
|
|
|
|
|
icon: 'create'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 11,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: 'Elimina',
|
|
|
|
|
value: lists.MenuAction.DELETE,
|
|
|
|
|
icon: 'delete',
|
|
|
|
|
checked: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 12,
|
|
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: '',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.PROGRESS_BAR,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'rowing',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 20,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Imposta Priorità',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.PRIORITY,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'rowing',
|
2019-04-29 23:47:42 +02:00
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectPriority.it
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 21,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.it.proj.themecolor,
|
|
|
|
|
value: lists.MenuAction.THEME,
|
|
|
|
|
icon: 'format_color_text',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 22,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.it.proj.themebgcolor,
|
|
|
|
|
value: lists.MenuAction.THEMEBG,
|
|
|
|
|
icon: 'format_color_fill',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
2019-04-05 23:59:52 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 30,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Completato',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.COMPLETED,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'check_circle',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 40,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Imposta Scadenza',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.TOGGLE_EXPIRING,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'date_range',
|
|
|
|
|
checked: true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
es:
|
|
|
|
|
[
|
2019-04-29 01:01:31 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: 'Cortar',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.CUT,
|
2019-04-29 01:01:31 +02:00
|
|
|
icon: 'undo'
|
|
|
|
|
},
|
2019-07-10 11:37:00 +02:00
|
|
|
{
|
|
|
|
|
id: 7,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: 'Editar',
|
|
|
|
|
value: lists.MenuAction.EDIT,
|
|
|
|
|
icon: 'create'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 8,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: 'Borrar',
|
|
|
|
|
value: lists.MenuAction.DELETE,
|
|
|
|
|
icon: 'delete',
|
|
|
|
|
checked: false
|
|
|
|
|
},
|
2019-04-05 23:59:52 +02:00
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: '',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.PROGRESS_BAR,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'rowing',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 20,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Establecer Prioridad',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.PRIORITY,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'rowing',
|
2019-04-29 23:47:42 +02:00
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectPriority.es
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 21,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.es.proj.themecolor,
|
|
|
|
|
value: lists.MenuAction.THEME,
|
|
|
|
|
icon: 'format_color_text',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 22,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.es.proj.themebgcolor,
|
|
|
|
|
value: lists.MenuAction.THEMEBG,
|
|
|
|
|
icon: 'format_color_fill',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
2019-04-05 23:59:52 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 30,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Completado',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.COMPLETED,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'check_circle',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 40,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Establecer expiración',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.TOGGLE_EXPIRING,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'date_range',
|
|
|
|
|
checked: true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
enUs:
|
|
|
|
|
[
|
2019-04-29 01:01:31 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: 'Cut',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.CUT,
|
2019-04-29 01:01:31 +02:00
|
|
|
icon: 'undo'
|
|
|
|
|
},
|
2019-07-10 11:37:00 +02:00
|
|
|
{
|
|
|
|
|
id: 7,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: 'Edit',
|
|
|
|
|
value: lists.MenuAction.EDIT,
|
|
|
|
|
icon: 'create'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 8,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: 'Delete',
|
|
|
|
|
value: lists.MenuAction.DELETE,
|
|
|
|
|
icon: 'trash',
|
|
|
|
|
checked: false
|
|
|
|
|
},
|
2019-04-05 23:59:52 +02:00
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: '',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.PROGRESS_BAR,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'check_circle',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 20,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Set Priority',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.PRIORITY,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'high_priority',
|
2019-04-29 23:47:42 +02:00
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectPriority.enUs
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 21,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.enUs.proj.themecolor,
|
|
|
|
|
value: lists.MenuAction.THEME,
|
|
|
|
|
icon: 'format_color_text',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 22,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.enUs.proj.themebgcolor,
|
|
|
|
|
value: lists.MenuAction.THEMEBG,
|
|
|
|
|
icon: 'format_color_fill',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
2019-04-05 23:59:52 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 30,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Completed',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.COMPLETED,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'check_circle',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 40,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Set Expiring',
|
2019-04-29 23:47:42 +02:00
|
|
|
value: lists.MenuAction.TOGGLE_EXPIRING,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'date_range',
|
|
|
|
|
checked: true
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
,
|
2019-02-03 03:44:25 +01:00
|
|
|
|
2019-03-28 12:58:34 +01:00
|
|
|
menuPopupProj: {
|
|
|
|
|
it: [
|
2019-04-27 20:12:41 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-27 20:12:41 +02:00
|
|
|
label: 'Taglia',
|
2019-07-10 11:37:00 +02:00
|
|
|
value: lists.MenuAction.CUT,
|
2019-04-27 20:12:41 +02:00
|
|
|
icon: 'undo'
|
|
|
|
|
},
|
2019-03-30 02:57:40 +01:00
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-03-30 02:57:40 +01:00
|
|
|
label: 'Modifica',
|
2019-07-10 11:37:00 +02:00
|
|
|
value: lists.MenuAction.EDIT,
|
2019-03-30 02:57:40 +01:00
|
|
|
icon: 'create'
|
|
|
|
|
},
|
2019-07-10 11:37:00 +02:00
|
|
|
{
|
|
|
|
|
id: 11,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: 'Elimina',
|
|
|
|
|
value: lists.MenuAction.DELETE,
|
|
|
|
|
icon: 'delete',
|
|
|
|
|
checked: false
|
|
|
|
|
},
|
2019-03-28 12:58:34 +01:00
|
|
|
{
|
|
|
|
|
id: 40,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-03-28 12:58:34 +01:00
|
|
|
label: 'Imposta Scadenza',
|
2019-07-10 11:37:00 +02:00
|
|
|
value: lists.MenuAction.TOGGLE_EXPIRING,
|
2019-03-28 12:58:34 +01:00
|
|
|
icon: 'date_range',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
2019-04-29 23:47:42 +02:00
|
|
|
{
|
|
|
|
|
id: 45,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.it.proj.themecolor,
|
|
|
|
|
value: lists.MenuAction.THEME,
|
|
|
|
|
icon: 'format_color_text',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 46,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.it.proj.themebgcolor,
|
|
|
|
|
value: lists.MenuAction.THEMEBG,
|
|
|
|
|
icon: 'format_color_fill',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
2019-03-28 12:58:34 +01:00
|
|
|
}
|
|
|
|
|
],
|
2019-04-05 23:59:52 +02:00
|
|
|
es:
|
|
|
|
|
[
|
2019-04-27 20:12:41 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-27 20:12:41 +02:00
|
|
|
label: 'Cortar',
|
2019-07-10 11:37:00 +02:00
|
|
|
value: lists.MenuAction.CUT,
|
2019-04-27 20:12:41 +02:00
|
|
|
icon: 'undo'
|
|
|
|
|
},
|
2019-04-05 23:59:52 +02:00
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Editar',
|
2019-07-10 11:37:00 +02:00
|
|
|
value: lists.MenuAction.EDIT,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'create'
|
|
|
|
|
},
|
2019-07-10 11:37:00 +02:00
|
|
|
{
|
|
|
|
|
id: 11,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: 'Borrar',
|
|
|
|
|
value: 100, // DELETE
|
|
|
|
|
icon: 'delete',
|
|
|
|
|
checked: false
|
|
|
|
|
},
|
2019-04-05 23:59:52 +02:00
|
|
|
{
|
|
|
|
|
id: 40,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Establecer expiración',
|
2019-07-10 11:37:00 +02:00
|
|
|
value: lists.MenuAction.TOGGLE_EXPIRING,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'date_range',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
2019-04-29 23:47:42 +02:00
|
|
|
{
|
|
|
|
|
id: 45,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.es.proj.themecolor,
|
|
|
|
|
value: lists.MenuAction.THEME,
|
|
|
|
|
icon: 'format_color_text',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 46,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.es.proj.themebgcolor,
|
|
|
|
|
value: lists.MenuAction.THEMEBG,
|
|
|
|
|
icon: 'format_color_fill',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
enUs:
|
|
|
|
|
[
|
2019-04-27 20:12:41 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-27 20:12:41 +02:00
|
|
|
label: 'Cut',
|
|
|
|
|
value: 71, // CUT
|
|
|
|
|
icon: 'undo'
|
|
|
|
|
},
|
2019-04-05 23:59:52 +02:00
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Edit',
|
2019-07-10 11:37:00 +02:00
|
|
|
value: lists.MenuAction.EDIT,
|
2019-04-05 23:59:52 +02:00
|
|
|
icon: 'create'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 40,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Set Expiring',
|
|
|
|
|
value: 101, // TOGGLE_EXPIRING
|
|
|
|
|
icon: 'date_range',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
2019-04-29 23:47:42 +02:00
|
|
|
{
|
|
|
|
|
id: 45,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.enUs.proj.themecolor,
|
|
|
|
|
value: lists.MenuAction.THEME,
|
|
|
|
|
icon: 'format_color_text',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 46,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.enUs.proj.themebgcolor,
|
|
|
|
|
value: lists.MenuAction.THEMEBG,
|
|
|
|
|
icon: 'format_color_fill',
|
|
|
|
|
checked: false,
|
|
|
|
|
arrlista: lists.selectTheme
|
|
|
|
|
},
|
2019-04-05 23:59:52 +02:00
|
|
|
{
|
|
|
|
|
id: 50,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Delete',
|
|
|
|
|
value: 100, // DELETE
|
|
|
|
|
icon: 'trash',
|
|
|
|
|
checked: false
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
,
|
2019-03-28 12:58:34 +01:00
|
|
|
|
2019-03-04 17:28:29 +01:00
|
|
|
menuPopupConfigTodo: {
|
2019-03-13 01:53:53 +01:00
|
|
|
it: [
|
2019-03-04 17:28:29 +01:00
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-03-04 17:28:29 +01:00
|
|
|
label: 'Mostra Task',
|
|
|
|
|
value: 150, // SHOW_TASK
|
2019-03-13 01:53:53 +01:00
|
|
|
icon: 'rowing'
|
|
|
|
|
}
|
2019-03-04 17:28:29 +01:00
|
|
|
],
|
2019-04-05 23:59:52 +02:00
|
|
|
es:
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Mostrar Tareas',
|
|
|
|
|
value: 150,
|
|
|
|
|
icon: 'rowing'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
enUs:
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-29 01:01:31 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Show Task',
|
|
|
|
|
value: 150,
|
|
|
|
|
icon: 'rowing'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
,
|
2019-03-04 17:28:29 +01:00
|
|
|
|
2019-03-28 12:58:34 +01:00
|
|
|
menuPopupConfigProject: {
|
|
|
|
|
it: [
|
2019-04-27 20:12:41 +02:00
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.it.action.paste,
|
|
|
|
|
value: 72, // Action.PASTE
|
|
|
|
|
icon: 'file_copy'
|
|
|
|
|
},
|
2019-04-02 00:18:01 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-09 21:07:16 +02:00
|
|
|
label: translation.it.proj.newsubproj,
|
2019-04-02 00:18:01 +02:00
|
|
|
value: 200, // ADD_PROJECT
|
|
|
|
|
icon: 'next_week'
|
|
|
|
|
},
|
2019-03-28 12:58:34 +01:00
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-09 21:07:16 +02:00
|
|
|
label: translation.it.task.showtask,
|
2019-03-28 12:58:34 +01:00
|
|
|
value: 150, // SHOW_TASK
|
|
|
|
|
icon: 'rowing'
|
|
|
|
|
}
|
|
|
|
|
],
|
2019-04-05 23:59:52 +02:00
|
|
|
es:
|
|
|
|
|
[
|
2019-04-27 20:12:41 +02:00
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.es.action.paste,
|
|
|
|
|
value: 72, // Action.PASTE
|
|
|
|
|
icon: 'file_copy'
|
|
|
|
|
},
|
2019-04-05 23:59:52 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-09 21:07:16 +02:00
|
|
|
label: translation.es.proj.newsubproj,
|
2019-04-05 23:59:52 +02:00
|
|
|
value: 200, // ADD_PROJECT
|
|
|
|
|
icon: 'next_week'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-09 21:07:16 +02:00
|
|
|
label: translation.es.task.showtask,
|
2019-04-05 23:59:52 +02:00
|
|
|
value: 150,
|
|
|
|
|
icon: 'rowing'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
enUs:
|
|
|
|
|
[
|
2019-04-27 20:12:41 +02:00
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.enUs.action.paste,
|
|
|
|
|
value: 72, // Action.PASTE
|
|
|
|
|
icon: 'file_copy'
|
|
|
|
|
},
|
2019-04-05 23:59:52 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
|
|
|
|
label: translation.enUs.proj.newsubproj,
|
2019-04-05 23:59:52 +02:00
|
|
|
value: 200, // ADD_PROJECT
|
|
|
|
|
icon: 'next_week'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-09 21:07:16 +02:00
|
|
|
label: translation.enUs.task.showtask,
|
2019-04-05 23:59:52 +02:00
|
|
|
value: 150,
|
|
|
|
|
icon: 'rowing'
|
|
|
|
|
}
|
|
|
|
|
]
|
2019-04-09 21:07:16 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
menuPopupConfigMAINProject: {
|
|
|
|
|
it: [
|
2019-04-27 20:12:41 +02:00
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.it.action.paste,
|
|
|
|
|
value: 72, // Action.PASTE
|
|
|
|
|
icon: 'file_copy'
|
|
|
|
|
},
|
2019-04-09 21:07:16 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-09 21:07:16 +02:00
|
|
|
label: translation.it.proj.newproj,
|
|
|
|
|
value: 200, // ADD_PROJECT
|
|
|
|
|
icon: 'next_week'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
es:
|
|
|
|
|
[
|
2019-04-27 20:12:41 +02:00
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.es.action.paste,
|
|
|
|
|
value: 72, // Action.PASTE
|
|
|
|
|
icon: 'file_copy'
|
|
|
|
|
},
|
2019-04-09 21:07:16 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-09 21:07:16 +02:00
|
|
|
label: translation.es.proj.newproj,
|
|
|
|
|
value: 200, // ADD_PROJECT
|
|
|
|
|
icon: 'next_week'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
enUs:
|
|
|
|
|
[
|
2019-04-27 20:12:41 +02:00
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
disable: false,
|
|
|
|
|
label: translation.enUs.action.paste,
|
|
|
|
|
value: 72, // Action.PASTE
|
|
|
|
|
icon: 'file_copy'
|
|
|
|
|
},
|
2019-04-09 21:07:16 +02:00
|
|
|
{
|
|
|
|
|
id: 5,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
|
|
|
|
label: translation.enUs.proj.newproj,
|
2019-04-09 21:07:16 +02:00
|
|
|
value: 200, // ADD_PROJECT
|
|
|
|
|
icon: 'next_week'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
2019-03-28 12:58:34 +01:00
|
|
|
|
2019-03-04 17:28:29 +01:00
|
|
|
listOptionShowTask: {
|
2019-03-13 01:53:53 +01:00
|
|
|
it: [
|
2019-03-04 17:28:29 +01:00
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-03-04 17:28:29 +01:00
|
|
|
label: 'Mostra gli ultimi N completati',
|
|
|
|
|
value: costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED,
|
|
|
|
|
icon: 'rowing',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 20,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-03-04 17:28:29 +01:00
|
|
|
label: 'Compiti da Completare',
|
|
|
|
|
value: costanti.ShowTypeTask.SHOW_ONLY_TOCOMPLETE,
|
|
|
|
|
icon: 'rowing',
|
|
|
|
|
checked: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 30,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-03-04 17:28:29 +01:00
|
|
|
label: 'Tutti i compiti',
|
|
|
|
|
value: costanti.ShowTypeTask.SHOW_ALL,
|
|
|
|
|
icon: 'check_circle',
|
|
|
|
|
checked: true
|
|
|
|
|
}
|
|
|
|
|
],
|
2019-04-05 23:59:52 +02:00
|
|
|
es:
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Mostrar los ultimos N completados',
|
|
|
|
|
value: costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED,
|
|
|
|
|
icon: 'rowing',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 20,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Tareas para completar',
|
|
|
|
|
value: costanti.ShowTypeTask.SHOW_ONLY_TOCOMPLETE,
|
|
|
|
|
icon: 'rowing',
|
|
|
|
|
checked: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 30,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Todos las Tareas',
|
|
|
|
|
value: costanti.ShowTypeTask.SHOW_ALL,
|
|
|
|
|
icon: 'check_circle',
|
|
|
|
|
checked: true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
enUs:
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
id: 10,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Show last N Completed',
|
|
|
|
|
value: costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED,
|
|
|
|
|
icon: 'rowing',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 20,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'Task to complete',
|
|
|
|
|
value: costanti.ShowTypeTask.SHOW_ONLY_TOCOMPLETE,
|
|
|
|
|
icon: 'rowing',
|
|
|
|
|
checked: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 30,
|
2019-04-27 20:12:41 +02:00
|
|
|
disable: false,
|
2019-04-05 23:59:52 +02:00
|
|
|
label: 'All Tasks',
|
|
|
|
|
value: costanti.ShowTypeTask.SHOW_ALL,
|
|
|
|
|
icon: 'check_circle',
|
|
|
|
|
checked: true
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
,
|
2019-03-04 17:28:29 +01:00
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
getTitlePriority(priority) {
|
|
|
|
|
let cl = ''
|
|
|
|
|
|
|
|
|
|
if (priority === tools.Priority.PRIORITY_HIGH) {
|
|
|
|
|
cl = 'high_priority'
|
|
|
|
|
}
|
|
|
|
|
else if (priority === tools.Priority.PRIORITY_NORMAL) {
|
|
|
|
|
cl = 'medium_priority'
|
|
|
|
|
}
|
|
|
|
|
else if (priority === tools.Priority.PRIORITY_LOW) {
|
|
|
|
|
cl = 'low_priority'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return cl + ' titlePriority'
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-04-05 16:16:29 +02:00
|
|
|
getStatusListByInd(index) {
|
|
|
|
|
try {
|
2019-07-12 14:09:44 +02:00
|
|
|
const arr = tools.selectStatus[toolsext.getLocale()]
|
2019-04-05 16:16:29 +02:00
|
|
|
for (const rec of arr) {
|
|
|
|
|
if (rec.value === index) {
|
|
|
|
|
return rec.label
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log('Error: ', e)
|
|
|
|
|
}
|
|
|
|
|
return ''
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-04-05 16:16:29 +02:00
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
getPriorityByInd(index) {
|
2019-07-12 14:09:44 +02:00
|
|
|
// console.log('LANG in PRIOR', toolsext.getLocale())
|
2019-03-22 20:51:42 +01:00
|
|
|
try {
|
2019-07-12 14:09:44 +02:00
|
|
|
const arr = lists.selectPriority[toolsext.getLocale()]
|
2019-03-22 20:51:42 +01:00
|
|
|
for (const rec of arr) {
|
|
|
|
|
if (rec.value === index) {
|
|
|
|
|
return rec.label
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log('Error: ', e)
|
|
|
|
|
}
|
|
|
|
|
return ''
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
logelem(mystr, elem) {
|
|
|
|
|
console.log(mystr, 'elem [', elem._id, '] ', elem.descr, ' Pr(', tools.getPriorityByInd(elem.priority), ') [', elem.id_prev, '] modif=', elem.modified)
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-03-30 02:57:40 +01:00
|
|
|
getelemprojstr(elem) {
|
|
|
|
|
return 'elem [id= ' + elem._id + '] ' + elem.descr + ' [id_prev= ' + elem.id_prev + '] '
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-30 02:57:40 +01:00
|
|
|
|
2019-04-07 21:24:10 +02:00
|
|
|
logga_arrproj(myarr: IProject[]) {
|
2019-03-30 02:57:40 +01:00
|
|
|
let mystr = '\n'
|
|
|
|
|
myarr.forEach((item) => {
|
|
|
|
|
mystr += tools.getelemprojstr(item) + ' '
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return mystr
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-30 02:57:40 +01:00
|
|
|
|
|
|
|
|
logelemprj(mystr, elem) {
|
|
|
|
|
console.log(mystr, tools.getelemprojstr(elem))
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-30 02:57:40 +01:00
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
getstrelem(elem) {
|
|
|
|
|
return 'elem [' + elem._id + '] ' + elem.descr + ' Pr(' + tools.getPriorityByInd(elem.priority) + ') [ID_PREV=' + elem.id_prev + '] modif=' + elem.modified + ' '
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-04-05 23:59:52 +02:00
|
|
|
logga_arr(myarr
|
|
|
|
|
:
|
|
|
|
|
ITodo[]
|
|
|
|
|
) {
|
2019-03-22 20:51:42 +01:00
|
|
|
let mystr = '\n'
|
|
|
|
|
myarr.forEach((item) => {
|
|
|
|
|
mystr += '[' + item.pos + '] ' + item.descr + ' Pr(' + tools.getPriorityByInd(item.priority) + ') [' + item.id_prev + '] modif=' + item.modified + '\n'
|
|
|
|
|
// mystr += '[' + item.pos + '] ' + item.descr + '\n'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return mystr
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
touchmove(scrollable) {
|
|
|
|
|
if (window) {
|
|
|
|
|
window.addEventListener('touchmove', (e) => {
|
|
|
|
|
// console.log('touchmove')
|
|
|
|
|
if (!scrollable) {
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
}
|
|
|
|
|
}, { passive: false })
|
|
|
|
|
}
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-02-15 01:25:44 +01:00
|
|
|
jsonCopy(src) {
|
|
|
|
|
return JSON.parse(JSON.stringify(src))
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-02-20 11:53:56 +01:00
|
|
|
|
|
|
|
|
getItemLS(item) {
|
|
|
|
|
let ris = localStorage.getItem(item)
|
2020-05-10 21:06:42 +02:00
|
|
|
if ((ris == null) || (ris === '') || (ris === 'null') || !ris) {
|
2019-02-20 11:53:56 +01:00
|
|
|
ris = ''
|
2019-03-13 01:53:53 +01:00
|
|
|
}
|
2019-02-20 11:53:56 +01:00
|
|
|
|
|
|
|
|
return ris
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-02-15 01:25:44 +01:00
|
|
|
|
2019-02-27 02:58:41 +01:00
|
|
|
notifyarraychanged(array) {
|
2019-03-13 01:53:53 +01:00
|
|
|
if (array.length > 0) {
|
2019-02-27 02:58:41 +01:00
|
|
|
array.splice(array.length - 1, 1, array[array.length - 1])
|
2019-03-13 01:53:53 +01:00
|
|
|
}
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-02-27 02:58:41 +01:00
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
isOkIndex(myarr, index) {
|
|
|
|
|
return (index >= 0 && index < myarr.length)
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
update_idprev(myarr, indelemchange, indelemId) {
|
2019-03-30 02:57:40 +01:00
|
|
|
if (tools.isOkIndex(myarr, indelemchange)) {
|
2019-03-22 20:51:42 +01:00
|
|
|
const id_prev = (indelemId >= 0) ? myarr[indelemId]._id : ApiTables.LIST_START
|
2019-03-30 02:57:40 +01:00
|
|
|
console.log('update_idprev [', indelemchange, ']', '[id_prev=', id_prev, ']')
|
2019-03-22 20:51:42 +01:00
|
|
|
if (myarr[indelemchange].id_prev !== id_prev) {
|
2019-03-30 02:57:40 +01:00
|
|
|
// tools.notifyarraychanged(myarr)
|
2019-03-22 20:51:42 +01:00
|
|
|
// myarr[indelemchange].modified = true
|
2019-03-30 02:57:40 +01:00
|
|
|
// console.log('update_idprev Index=', indelemchange, 'indtoget', indelemId, tools.getstrelem(myarr[indelemchange]))
|
2019-04-02 00:18:01 +02:00
|
|
|
console.log(' MODIFICATO! ', myarr[indelemchange].descr, ' PRIMA:', myarr[indelemchange].id_prev, 'DOPO: ', id_prev)
|
2019-03-30 02:57:40 +01:00
|
|
|
myarr[indelemchange].id_prev = id_prev
|
2019-03-22 20:51:42 +01:00
|
|
|
return myarr[indelemchange]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-04-05 23:59:52 +02:00
|
|
|
async swapGeneralElem(nametable, myarr, itemdragend, listFieldsToChange) {
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
if (itemdragend.field === 'priority') {
|
|
|
|
|
// get last elem priority
|
|
|
|
|
console.log('get last elem priority')
|
2019-04-03 02:48:05 +02:00
|
|
|
itemdragend.newIndex = tools.getLastFirstElemPriority(myarr, itemdragend.prioritychosen, itemdragend.atfirst, itemdragend.idelemtochange)
|
|
|
|
|
itemdragend.oldIndex = tools.getIndexById(myarr, itemdragend.idelemtochange)
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
console.log('swapElems PRIORITY', itemdragend)
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-30 02:57:40 +01:00
|
|
|
if (itemdragend.newIndex === itemdragend.oldIndex) {
|
2019-03-28 12:58:34 +01:00
|
|
|
return
|
2019-03-30 02:57:40 +01:00
|
|
|
}
|
2019-03-28 12:58:34 +01:00
|
|
|
|
2019-04-07 21:24:10 +02:00
|
|
|
console.log('swapGeneralElem', 'new =', itemdragend.newIndex, 'Old =', itemdragend.oldIndex, itemdragend)
|
|
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
if (tools.isOkIndex(myarr, itemdragend.newIndex) && tools.isOkIndex(myarr, itemdragend.oldIndex)) {
|
2019-03-30 02:57:40 +01:00
|
|
|
|
2019-04-29 23:47:42 +02:00
|
|
|
console.log('*** SPLICE!')
|
2019-04-07 21:24:10 +02:00
|
|
|
// console.log(' PRIMA!', tools.logga_arrproj(myarr))
|
2019-03-22 20:51:42 +01:00
|
|
|
myarr.splice(itemdragend.newIndex, 0, myarr.splice(itemdragend.oldIndex, 1)[0])
|
2019-04-07 21:24:10 +02:00
|
|
|
// console.log(' DOPO!', tools.logga_arrproj(myarr))
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-03-30 02:57:40 +01:00
|
|
|
// Ora inverti gli indici
|
|
|
|
|
const indold = itemdragend.oldIndex
|
|
|
|
|
itemdragend.oldIndex = itemdragend.newIndex
|
|
|
|
|
itemdragend.newIndex = indold
|
|
|
|
|
|
|
|
|
|
if (nametable === 'todos') {
|
|
|
|
|
if (itemdragend.field !== 'priority') {
|
|
|
|
|
const precind = itemdragend.newIndex - 1
|
|
|
|
|
const nextind = itemdragend.newIndex + 1
|
|
|
|
|
|
|
|
|
|
if (tools.isOkIndex(myarr, precind) && tools.isOkIndex(myarr, nextind)) {
|
|
|
|
|
if ((myarr[precind].priority === myarr[nextind].priority) && (myarr[precind].priority !== myarr[itemdragend.newIndex].priority)) {
|
|
|
|
|
console.log(' 1)')
|
2019-03-22 20:51:42 +01:00
|
|
|
myarr[itemdragend.newIndex].priority = myarr[precind].priority
|
2019-03-30 02:57:40 +01:00
|
|
|
tools.notifyarraychanged(myarr)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (!tools.isOkIndex(myarr, precind)) {
|
|
|
|
|
if ((myarr[nextind].priority !== myarr[itemdragend.newIndex].priority)) {
|
|
|
|
|
console.log(' 2)')
|
|
|
|
|
myarr[itemdragend.newIndex].priority = myarr[nextind].priority
|
|
|
|
|
tools.notifyarraychanged(myarr)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
if ((myarr[precind].priority !== myarr[itemdragend.newIndex].priority)) {
|
|
|
|
|
console.log(' 3)')
|
|
|
|
|
myarr[itemdragend.newIndex].priority = myarr[precind].priority
|
|
|
|
|
tools.notifyarraychanged(myarr)
|
|
|
|
|
}
|
2019-03-22 20:51:42 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-30 02:57:40 +01:00
|
|
|
}
|
2019-03-22 20:51:42 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update the id_prev property
|
2019-03-30 02:57:40 +01:00
|
|
|
const elem1 = tools.update_idprev(myarr, itemdragend.newIndex, itemdragend.newIndex - 1) // 0, -1
|
|
|
|
|
const elem2 = tools.update_idprev(myarr, itemdragend.newIndex + 1, itemdragend.newIndex) // 1, 0
|
|
|
|
|
const elem3 = tools.update_idprev(myarr, itemdragend.oldIndex, itemdragend.oldIndex - 1) // 1, 0
|
|
|
|
|
const elem4 = tools.update_idprev(myarr, itemdragend.oldIndex + 1, itemdragend.oldIndex) // 2, 1
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-04-05 23:59:52 +02:00
|
|
|
await
|
|
|
|
|
ApiTables.table_ModifyRecord(nametable, elem1, listFieldsToChange, 'id_prev')
|
|
|
|
|
await
|
|
|
|
|
ApiTables.table_ModifyRecord(nametable, elem2, listFieldsToChange, 'id_prev')
|
|
|
|
|
await
|
|
|
|
|
ApiTables.table_ModifyRecord(nametable, elem3, listFieldsToChange, 'id_prev')
|
|
|
|
|
await
|
|
|
|
|
ApiTables.table_ModifyRecord(nametable, elem4, listFieldsToChange, 'id_prev')
|
2019-03-30 02:57:40 +01:00
|
|
|
|
|
|
|
|
tools.notifyarraychanged(myarr)
|
|
|
|
|
|
|
|
|
|
console.log('arr FINALE', tools.logga_arrproj(myarr))
|
|
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
// Update the records:
|
|
|
|
|
}
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
getIndexById(myarr, id) {
|
2019-04-22 01:43:53 +02:00
|
|
|
if (myarr === undefined)
|
|
|
|
|
return -1
|
2019-03-28 12:58:34 +01:00
|
|
|
return myarr.indexOf(tools.getElemById(myarr, id))
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
getElemById(myarr, id) {
|
2019-04-22 01:43:53 +02:00
|
|
|
if (myarr === undefined)
|
|
|
|
|
return null
|
2019-04-07 21:24:10 +02:00
|
|
|
// console.log('getElemById', myarr, id)
|
2019-03-22 20:51:42 +01:00
|
|
|
return myarr.find((elem) => elem._id === id)
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
getElemPrevById(myarr, id) {
|
2019-04-22 01:43:53 +02:00
|
|
|
if (myarr === undefined)
|
|
|
|
|
return null
|
2019-03-22 20:51:42 +01:00
|
|
|
return myarr.find((elem) => elem.id_prev === id)
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
|
2019-04-22 01:43:53 +02:00
|
|
|
getLastFirstElemPriority(myarr, priority: number, atfirst: boolean, escludiId: string) {
|
2019-03-22 20:51:42 +01:00
|
|
|
if (myarr === null) {
|
|
|
|
|
return -1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let trovato: boolean = false
|
|
|
|
|
|
|
|
|
|
console.log('priority', priority)
|
|
|
|
|
|
|
|
|
|
for (let indrec = 0; indrec < myarr.length; indrec++) {
|
|
|
|
|
if ((myarr[indrec].priority === priority) && (myarr[indrec]._id !== escludiId)) {
|
|
|
|
|
trovato = true
|
|
|
|
|
if (atfirst) {
|
|
|
|
|
return indrec - 1
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (trovato) {
|
|
|
|
|
return indrec
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log('trovato?', trovato, 'indrec')
|
|
|
|
|
|
|
|
|
|
if (trovato) {
|
|
|
|
|
return myarr.length - 1
|
|
|
|
|
} else {
|
|
|
|
|
if (priority === tools.Priority.PRIORITY_LOW) {
|
|
|
|
|
return myarr.length - 1
|
|
|
|
|
}
|
|
|
|
|
else if (priority === tools.Priority.PRIORITY_HIGH) {
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
getFirstList(myarr) {
|
|
|
|
|
return myarr.find((elem) => elem.id_prev === ApiTables.LIST_START)
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-03-28 12:58:34 +01:00
|
|
|
getModulesByTable(nametable) {
|
2019-03-22 20:51:42 +01:00
|
|
|
if (nametable === 'todos') {
|
2019-03-28 12:58:34 +01:00
|
|
|
return Todos
|
2019-03-22 20:51:42 +01:00
|
|
|
} else if (nametable === 'projects') {
|
2019-03-28 12:58:34 +01:00
|
|
|
return Projects
|
2019-03-22 20:51:42 +01:00
|
|
|
}
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-28 12:58:34 +01:00
|
|
|
|
2019-04-02 00:18:01 +02:00
|
|
|
setArrayMainByTable(nametable, myarr) {
|
|
|
|
|
if (nametable === 'todos') {
|
|
|
|
|
Todos.state.todos = tools.jsonCopy(myarr)
|
|
|
|
|
return Todos.state.todos
|
|
|
|
|
} else if (nametable === 'projects') {
|
|
|
|
|
Projects.state.projects = tools.jsonCopy(myarr)
|
|
|
|
|
return Projects.state.projects
|
|
|
|
|
}
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-04-02 00:18:01 +02:00
|
|
|
|
|
|
|
|
getmyid(id) {
|
|
|
|
|
return 'row' + id
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-04-02 00:18:01 +02:00
|
|
|
|
2019-04-29 02:47:53 +02:00
|
|
|
getLastListNotCompleted(nametable, cat, tipoproj: string) {
|
2019-07-10 11:37:00 +02:00
|
|
|
// console.log('getLastListNotCompleted')
|
2019-04-22 01:43:53 +02:00
|
|
|
// const module = tools.getModulesByTable(nametable)
|
|
|
|
|
let arr = []
|
|
|
|
|
if (nametable === 'projects')
|
2019-04-29 02:47:53 +02:00
|
|
|
arr = Projects.getters.projs_dacompletare(cat, tipoproj)
|
2019-04-22 01:43:53 +02:00
|
|
|
else if (nametable === 'todos')
|
|
|
|
|
arr = Todos.getters.items_dacompletare(cat)
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-04-29 02:47:53 +02:00
|
|
|
if (!!arr)
|
|
|
|
|
return (arr.length > 0) ? arr[arr.length - 1] : null
|
|
|
|
|
else
|
|
|
|
|
return null
|
|
|
|
|
},
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
getElemByIndex(myarr, index) {
|
|
|
|
|
if (index >= 0 && index < myarr.length) {
|
|
|
|
|
return myarr[index]
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return null
|
|
|
|
|
}
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-02-27 02:58:41 +01:00
|
|
|
existArr(x) {
|
|
|
|
|
return x = (typeof x !== 'undefined' && x instanceof Array) ? x : []
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-02-27 02:58:41 +01:00
|
|
|
|
|
|
|
|
json2array(json) {
|
2019-03-13 01:53:53 +01:00
|
|
|
const result = []
|
|
|
|
|
const keys = Object.keys(json)
|
2019-03-21 20:43:15 +01:00
|
|
|
keys.forEach((key) => {
|
2019-02-27 02:58:41 +01:00
|
|
|
result.push(json[key])
|
|
|
|
|
})
|
|
|
|
|
return result
|
2019-10-10 16:53:33 +02:00
|
|
|
},
|
|
|
|
|
|
2019-11-17 01:07:23 +01:00
|
|
|
visumenu(elem) { // : IListRoutes
|
2019-12-31 00:44:43 +01:00
|
|
|
let visu = ((elem.onlyAdmin && UserStore.state.isAdmin) || (elem.onlyManager && UserStore.state.isManager)
|
2020-05-10 21:06:42 +02:00
|
|
|
|| (elem.onlyTutor && UserStore.state.isTutor) || (elem.onlyTraduttrici && UserStore.state.isTraduttrici)
|
|
|
|
|
|| ((!elem.onlyAdmin) && (!elem.onlyManager) && (!elem.onlyTutor) && (!elem.onlyTraduttrici))) && elem.active
|
2019-12-31 00:44:43 +01:00
|
|
|
|
2020-01-20 01:50:21 +01:00
|
|
|
if (!tools.isLoggedToSystem()) {
|
|
|
|
|
if (elem.onlyif_logged)
|
|
|
|
|
visu = false
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-31 00:44:43 +01:00
|
|
|
if (elem.meta && elem.meta.requiresAuth) {
|
|
|
|
|
visu = visu && tools.isLoggedToSystem()
|
|
|
|
|
}
|
|
|
|
|
return visu
|
2019-11-17 01:07:23 +01:00
|
|
|
},
|
|
|
|
|
|
2019-10-15 20:40:23 +02:00
|
|
|
executefunc(myself: any, table, func: number, par: IParamDialog) {
|
2019-10-12 23:34:58 +02:00
|
|
|
if (func === lists.MenuAction.DELETE) {
|
2020-03-10 21:42:30 +01:00
|
|
|
// console.log('param1', par.param1)
|
2019-10-16 15:27:49 +02:00
|
|
|
CalendarStore.actions.CancelBookingEvent({
|
|
|
|
|
ideventbook: par.param1,
|
|
|
|
|
notify: par.param2 === true ? '1' : '0'
|
|
|
|
|
}).then((ris) => {
|
2019-10-10 21:08:29 +02:00
|
|
|
if (ris) {
|
2019-11-05 23:53:18 +01:00
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param3 + '"')
|
2019-10-12 23:34:58 +02:00
|
|
|
if (myself.bookEventpage)
|
|
|
|
|
myself.bookEventpage.show = false
|
2019-10-10 21:08:29 +02:00
|
|
|
} else
|
2019-10-10 16:53:33 +02:00
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('cal.cancelederrorbooking'))
|
|
|
|
|
})
|
2019-10-24 23:30:18 +02:00
|
|
|
} else if (func === lists.MenuAction.DELETE_EVENT) {
|
2020-03-10 21:42:30 +01:00
|
|
|
// console.log('param1', par.param1, 'id', par.param1._id)
|
2019-10-24 23:30:18 +02:00
|
|
|
CalendarStore.actions.CancelEvent({ id: par.param1._id }).then((ris) => {
|
|
|
|
|
if (ris) {
|
|
|
|
|
// Remove this record from my list
|
|
|
|
|
CalendarStore.state.eventlist = CalendarStore.state.eventlist.filter((event) => (event._id !== par.param1._id))
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledevent') + ' "' + par.param1.title + '"')
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('cal.cancelederrorevent'))
|
|
|
|
|
})
|
2020-02-02 04:07:24 +01:00
|
|
|
} else if (func === lists.MenuAction.DELETE_EXTRALIST) {
|
|
|
|
|
// console.log('param1', par.param1, 'id', par.param1._id)
|
|
|
|
|
GlobalStore.actions.DeleteRec({ table: tools.TABEXTRALIST, id: par.param1._id }).then((ris) => {
|
|
|
|
|
if (ris) {
|
|
|
|
|
myself.update_username()
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('reg.cancella_invitato') + ' "' + par.param1.name + ' ' + par.param1.surname + '"')
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
2020-02-05 01:27:32 +01:00
|
|
|
} else if (func === lists.MenuAction.DELETE_USERLIST) {
|
|
|
|
|
// console.log('param1', par.param1, 'id', par.param1._id)
|
|
|
|
|
GlobalStore.actions.DeleteRec({ table: tools.TABUSER, id: par.param1._id }).then((ris) => {
|
|
|
|
|
if (ris) {
|
|
|
|
|
myself.update_username()
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('reg.cancella_invitato') + ' "' + par.param1.name + ' ' + par.param1.surname + '"')
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
2020-09-04 00:08:36 +02:00
|
|
|
} else if (func === lists.MenuAction.ZOOM_GIA_PARTECIPATO) {
|
|
|
|
|
// console.log('param1', par.param1, 'id', par.param1._id)
|
|
|
|
|
const mydatatosave = {
|
|
|
|
|
id: par.param1._id,
|
|
|
|
|
ind_order: par.param1.ind_order,
|
|
|
|
|
myfunc: func,
|
|
|
|
|
data: par.param2,
|
|
|
|
|
username: par.param2.username,
|
|
|
|
|
notifBot: null,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (par.param2.notifBot)
|
|
|
|
|
// mydatatosave.notifBot = { un: par.param2.notifBot, txt: par.param3 }
|
|
|
|
|
|
|
|
|
|
// myself.EseguiCallServer()
|
|
|
|
|
|
|
|
|
|
GlobalStore.actions.callFunz({ mydata: mydatatosave }).then((ris) => {
|
|
|
|
|
if (ris) {
|
|
|
|
|
myself.Callback(func)
|
|
|
|
|
tools.showPositiveNotif(myself.$q, par.param3)
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
2020-02-02 04:07:24 +01:00
|
|
|
} else if (func === lists.MenuAction.REGALA_INVITATO) {
|
2020-05-10 21:06:42 +02:00
|
|
|
// console.log('param1', par.param1, 'id', par.param1._id)
|
|
|
|
|
let mydatatosave = {
|
|
|
|
|
id: null,
|
|
|
|
|
username: '',
|
|
|
|
|
table: '',
|
|
|
|
|
fieldsvalue: {},
|
|
|
|
|
notifBot: {}
|
2020-05-19 00:18:55 +02:00
|
|
|
}
|
2020-05-10 21:06:42 +02:00
|
|
|
|
|
|
|
|
if (!!par.param1.invitante_username) {
|
|
|
|
|
mydatatosave = {
|
|
|
|
|
id: par.param1._id,
|
|
|
|
|
username: par.param1.username,
|
|
|
|
|
table: tools.TABLISTAINGRESSO,
|
|
|
|
|
fieldsvalue: { invitante_username: par.param2.aportador_solidario },
|
|
|
|
|
notifBot: null
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
mydatatosave = {
|
|
|
|
|
id: par.param1._id,
|
|
|
|
|
username: '',
|
|
|
|
|
table: tools.TABUSER,
|
|
|
|
|
fieldsvalue: { aportador_solidario: par.param2.aportador_solidario },
|
|
|
|
|
notifBot: null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log('** par.param1', par.param1)
|
|
|
|
|
console.log('** id', par.param1._id)
|
|
|
|
|
|
|
|
|
|
if (par.param3) {
|
|
|
|
|
mydatatosave.notifBot = { un: par.param2.aportador_solidario, txt: par.param3 }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GlobalStore.actions.saveFieldValue(mydatatosave).then((ris) => {
|
|
|
|
|
console.log('ris saveFieldValue', ris)
|
|
|
|
|
if (ris) {
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('reg.invitato_regalato') + ' "' + par.param1.name + ' ' + par.param1.surname + '"')
|
|
|
|
|
myself.update_username()
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
|
|
|
|
} else if (func === lists.MenuAction.REGALA_INVITANTE) {
|
2020-02-02 04:07:24 +01:00
|
|
|
// console.log('param1', par.param1, 'id', par.param1._id)
|
|
|
|
|
const mydatatosave = {
|
2020-05-10 21:06:42 +02:00
|
|
|
id: par.param1,
|
|
|
|
|
table: tools.TABLISTAINGRESSO,
|
|
|
|
|
fieldsvalue: { invitante_username: par.param2.invitante_username, ind_order_ingr: par.param2.ind_order_ingr },
|
2020-02-07 22:08:01 +01:00
|
|
|
notifBot: null
|
2020-02-02 04:07:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (par.param3) {
|
2020-05-10 21:06:42 +02:00
|
|
|
mydatatosave.notifBot = { un: par.param2.invitante_username, txt: par.param3 }
|
2020-02-02 04:07:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GlobalStore.actions.saveFieldValue(mydatatosave).then((ris) => {
|
2020-05-10 21:06:42 +02:00
|
|
|
console.log('ris saveFieldValue', ris)
|
2020-02-02 04:07:24 +01:00
|
|
|
if (ris) {
|
2020-05-13 01:33:07 +02:00
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('reg.invitante_regalato') + ' "' + par.param2.name + ' ' + par.param2.surname + '"')
|
2020-05-10 21:06:42 +02:00
|
|
|
myself.update_username()
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
|
|
|
|
} else if ((func === lists.MenuAction.AGGIUNGI_NUOVO_IMBARCO) || (func === lists.MenuAction.CANCELLA_IMBARCO)) {
|
|
|
|
|
const mydatatosave = {
|
|
|
|
|
username: par.param1.username,
|
|
|
|
|
invitante_username: '',
|
|
|
|
|
ind_order: -1,
|
2020-06-08 13:31:44 +02:00
|
|
|
num_tess: 0,
|
2020-05-10 21:06:42 +02:00
|
|
|
myfunc: func,
|
|
|
|
|
data: par.param2,
|
|
|
|
|
notifBot: null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (func === lists.MenuAction.CANCELLA_IMBARCO) {
|
|
|
|
|
mydatatosave.ind_order = par.param1.ind_order
|
2020-06-08 13:31:44 +02:00
|
|
|
mydatatosave.num_tess = par.param1.num_tess
|
2020-05-19 00:18:55 +02:00
|
|
|
mydatatosave.data.id = par.param2.rec._id
|
2020-05-10 21:06:42 +02:00
|
|
|
}
|
|
|
|
|
if (func === lists.MenuAction.AGGIUNGI_NUOVO_IMBARCO) {
|
|
|
|
|
mydatatosave.invitante_username = par.param1.invitante_username
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
myself.loading = true
|
|
|
|
|
|
|
|
|
|
mydatatosave.notifBot = { un: par.param2, txt: par.param3 }
|
|
|
|
|
|
|
|
|
|
GlobalStore.actions.callFunz({ mydata: mydatatosave }).then((ris) => {
|
|
|
|
|
myself.loading = false
|
|
|
|
|
if (ris) {
|
|
|
|
|
myself.update_username()
|
|
|
|
|
if (func === lists.MenuAction.AGGIUNGI_NUOVO_IMBARCO)
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('steps.sei_stato_aggiunto'))
|
|
|
|
|
else if (func === lists.MenuAction.CANCELLA_IMBARCO)
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('event.deleted'))
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
|
|
|
|
} else if (func === lists.MenuAction.SOSTITUISCI) {
|
|
|
|
|
// console.log('param1', par.param1, 'id', par.param1._id)
|
|
|
|
|
const mydatatosave = {
|
|
|
|
|
id: par.param1._id,
|
|
|
|
|
ind_order: par.param1.ind_order,
|
|
|
|
|
myfunc: func,
|
|
|
|
|
data: par.param2,
|
2020-05-11 22:43:54 +02:00
|
|
|
username: par.param2.username,
|
2020-06-08 13:31:44 +02:00
|
|
|
notifBot: null,
|
|
|
|
|
inviaemail: par.param2.inviaemail,
|
2020-05-10 21:06:42 +02:00
|
|
|
}
|
|
|
|
|
|
2020-05-11 22:43:54 +02:00
|
|
|
if (par.param2.notifBot)
|
2020-06-08 13:31:44 +02:00
|
|
|
mydatatosave.notifBot = { un: par.param2.notifBot, txt: par.param3 }
|
|
|
|
|
|
|
|
|
|
myself.EseguiCallServer()
|
2020-05-10 21:06:42 +02:00
|
|
|
|
|
|
|
|
GlobalStore.actions.callFunz({ mydata: mydatatosave }).then((ris) => {
|
|
|
|
|
if (ris) {
|
|
|
|
|
myself.update_nave()
|
2020-06-08 13:31:44 +02:00
|
|
|
myself.Callback()
|
2020-05-10 21:06:42 +02:00
|
|
|
tools.showPositiveNotif(myself.$q, par.param3 + '\n' + ' e inviato messaggio per aprire la Gift Chat!')
|
2020-02-02 04:07:24 +01:00
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
2019-10-15 20:40:23 +02:00
|
|
|
} else if (func === lists.MenuAction.DELETE_RECTABLE) {
|
2020-03-10 21:42:30 +01:00
|
|
|
// console.log('param1', par.param1)
|
2019-10-16 15:27:49 +02:00
|
|
|
GlobalStore.actions.DeleteRec({ table, id: par.param1 }).then((ris) => {
|
2019-10-15 20:40:23 +02:00
|
|
|
if (ris) {
|
2019-10-20 22:44:18 +02:00
|
|
|
myself.ActionAfterYes(func, par.param2, null)
|
2019-10-15 20:40:23 +02:00
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('db.deletedrecord'))
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recdelfailed'))
|
|
|
|
|
})
|
2019-10-20 22:44:18 +02:00
|
|
|
} else if (func === lists.MenuAction.DUPLICATE_RECTABLE) {
|
2020-03-10 21:42:30 +01:00
|
|
|
// console.log('param1', par.param1)
|
2019-10-20 22:44:18 +02:00
|
|
|
GlobalStore.actions.DuplicateRec({ table, id: par.param1 }).then((ris) => {
|
|
|
|
|
if (ris) {
|
|
|
|
|
myself.ActionAfterYes(func, par.param2, ris.data)
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('db.duplicatedrecord'))
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recdupfailed'))
|
|
|
|
|
})
|
2020-03-10 21:42:30 +01:00
|
|
|
} else if (func === lists.MenuAction.INVIA_MSG_A_DONATORI) {
|
|
|
|
|
// console.log('param1', par.param1)
|
2020-03-25 09:26:08 +01:00
|
|
|
GlobalStore.actions.InviaMsgADonatori({
|
|
|
|
|
msgobj: par.param1,
|
|
|
|
|
navemediatore: par.param2,
|
|
|
|
|
tipomsg: par.param1.tipomsg
|
|
|
|
|
}).then((ris) => {
|
2020-03-10 21:42:30 +01:00
|
|
|
if (ris) {
|
2020-03-21 10:33:10 +01:00
|
|
|
if (par.param1.inviareale)
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('dashboard.msg_donatori_ok'))
|
2020-03-10 21:42:30 +01:00
|
|
|
tools.askConfirm(myself.$q, '', ris.strout, translate('dialog.yes'), translate('dialog.no'), this, '', 0, 0, {})
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
2020-06-08 13:31:44 +02:00
|
|
|
} else if (func === lists.MenuAction.INVIA_MSG_A_FLOTTA) {
|
|
|
|
|
// console.log('param1', par.param1)
|
|
|
|
|
myself.loading = true
|
|
|
|
|
GlobalStore.actions.InviaMsgAFlotta({
|
|
|
|
|
flotta: par.param1,
|
|
|
|
|
inviareale: par.param2.inviareale,
|
|
|
|
|
inviaemail: par.param2.inviaemail,
|
|
|
|
|
tipomsg: par.param3
|
|
|
|
|
}).then((ris) => {
|
|
|
|
|
myself.loading = false
|
|
|
|
|
if (ris) {
|
|
|
|
|
if (par.param1.inviareale)
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('dashboard.msg_donatori_ok'))
|
|
|
|
|
tools.askConfirm(myself.$q, '', ris.strout, translate('dialog.yes'), translate('dialog.no'), this, '', 0, 0, {})
|
|
|
|
|
myself.Callback()
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
2020-03-25 09:26:08 +01:00
|
|
|
} else if (func === lists.MenuAction.INVIA_MSG_A_SINGOLO) {
|
|
|
|
|
// console.log('param1', par.param1)
|
|
|
|
|
GlobalStore.actions.InviaMsgADonatori({
|
|
|
|
|
msgobj: par.param1,
|
|
|
|
|
navemediatore: par.param2,
|
|
|
|
|
tipomsg: par.param1.tipomsg
|
|
|
|
|
})
|
|
|
|
|
.then((ris) => {
|
|
|
|
|
if (ris) {
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('cal.sendmsg_sent'))
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
2020-03-21 10:33:10 +01:00
|
|
|
} else if (func === lists.MenuAction.DONO_INVIATO) {
|
|
|
|
|
const mydatatosave = {
|
|
|
|
|
id: par.param1._id,
|
|
|
|
|
table: tools.TABNAVI,
|
2020-07-04 10:54:05 +02:00
|
|
|
fieldsvalue: {
|
|
|
|
|
date_made_gift: par.param1.date_made_gift,
|
|
|
|
|
riga: par.param1.riga,
|
|
|
|
|
col: par.param1.col,
|
|
|
|
|
commento_al_sognatore: par.param1.commento_al_sognatore
|
|
|
|
|
},
|
2020-03-21 10:33:10 +01:00
|
|
|
notifBot: null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (par.param3) {
|
|
|
|
|
mydatatosave.notifBot = { un: par.param2, txt: par.param3 }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GlobalStore.actions.saveFieldValue(mydatatosave).then((ris) => {
|
|
|
|
|
if (ris) {
|
|
|
|
|
myself.ActionAfterYes(func, par.param1, par.param2)
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('dashboard.fatto_dono'))
|
|
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
|
|
|
|
} else if (func === lists.MenuAction.DONO_RICEVUTO) {
|
2020-06-08 13:31:44 +02:00
|
|
|
let mydatatosave = {
|
2020-03-21 10:33:10 +01:00
|
|
|
id: par.param1._id,
|
|
|
|
|
table: tools.TABNAVI,
|
2020-06-08 13:31:44 +02:00
|
|
|
fieldsvalue: {},
|
2020-07-04 10:54:05 +02:00
|
|
|
unset: null,
|
2020-06-08 13:31:44 +02:00
|
|
|
notifBot: null,
|
|
|
|
|
tipomsg: tools.TipoMsg.SEND_MSG_DONO_RICEVUTO_CORRETTAMENTE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!!par.param1.date_made_gift) {
|
2020-07-04 10:54:05 +02:00
|
|
|
mydatatosave.fieldsvalue = {
|
|
|
|
|
made_gift: par.param1.made_gift,
|
|
|
|
|
riga: par.param1.riga,
|
|
|
|
|
col: par.param1.col,
|
|
|
|
|
date_made_gift: par.param1.date_made_gift
|
|
|
|
|
}
|
2020-06-08 13:31:44 +02:00
|
|
|
} else {
|
|
|
|
|
mydatatosave.fieldsvalue = { made_gift: par.param1.made_gift, riga: par.param1.riga, col: par.param1.col }
|
2020-03-21 10:33:10 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-04 10:54:05 +02:00
|
|
|
if (!!par.param1.annulla) {
|
|
|
|
|
if (par.param1.annulla) {
|
|
|
|
|
mydatatosave.fieldsvalue = { made_gift: false, riga: par.param1.riga, col: par.param1.col }
|
|
|
|
|
mydatatosave.unset = { date_made_gift: 1, received_gift: 1 }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-21 10:33:10 +01:00
|
|
|
if (par.param3) {
|
|
|
|
|
mydatatosave.notifBot = { un: par.param2, txt: par.param3 }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GlobalStore.actions.saveFieldValue(mydatatosave).then((ris) => {
|
|
|
|
|
if (ris) {
|
|
|
|
|
myself.ActionAfterYes(func, par.param1, par.param2)
|
2020-07-04 10:54:05 +02:00
|
|
|
let msg = myself.$t('dashboard.ricevuto_dono_ok')
|
|
|
|
|
if (!!par.param1.annulla) {
|
|
|
|
|
if (par.param1.annulla)
|
|
|
|
|
msg = 'Dono Annullato'
|
|
|
|
|
}
|
|
|
|
|
tools.showPositiveNotif(myself.$q, msg)
|
2020-03-21 10:33:10 +01:00
|
|
|
} else
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
})
|
2019-10-10 16:53:33 +02:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-07 22:08:01 +01:00
|
|
|
async saveFieldToServer(myself: any, table, id, mydata) {
|
|
|
|
|
const mydatatosave = {
|
|
|
|
|
id,
|
|
|
|
|
table,
|
|
|
|
|
fieldsvalue: mydata,
|
|
|
|
|
notifBot: null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GlobalStore.actions.saveFieldValue(mydatatosave).then((ris) => {
|
|
|
|
|
if (ris) {
|
|
|
|
|
tools.showPositiveNotif(myself.$q, myself.$t('db.recupdated'))
|
|
|
|
|
} else {
|
|
|
|
|
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-15 20:40:23 +02:00
|
|
|
async askConfirm($q: any, mytitle, mytext, ok, cancel, myself: any, table, funcok: number, funccancel: number, par: IParamDialog) {
|
2019-10-10 16:53:33 +02:00
|
|
|
return $q.dialog({
|
|
|
|
|
message: mytext,
|
2020-05-10 21:06:42 +02:00
|
|
|
html: true,
|
2019-10-10 16:53:33 +02:00
|
|
|
ok: {
|
|
|
|
|
label: ok,
|
|
|
|
|
push: true
|
|
|
|
|
},
|
|
|
|
|
title: mytitle,
|
|
|
|
|
cancel: true,
|
|
|
|
|
persistent: false
|
|
|
|
|
}).onOk(() => {
|
2020-01-20 01:50:21 +01:00
|
|
|
// console.log('OK')
|
2019-10-15 20:40:23 +02:00
|
|
|
tools.executefunc(myself, table, funcok, par)
|
2019-10-10 16:53:33 +02:00
|
|
|
return true
|
|
|
|
|
}).onCancel(() => {
|
2020-01-20 01:50:21 +01:00
|
|
|
// console.log('CANCEL')
|
2019-10-15 20:40:23 +02:00
|
|
|
tools.executefunc(myself, table, funccancel, par)
|
2019-10-10 16:53:33 +02:00
|
|
|
return false
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
showPositiveNotif(q: any, msg) {
|
|
|
|
|
tools.showNotif(q, msg, { color: 'positive', icon: 'notifications' })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
showNegativeNotif(q: any, msg) {
|
2020-02-12 20:41:57 +01:00
|
|
|
tools.showNotif(q, msg, { color: 'negative', icon: 'notifications' }, 10000)
|
2019-10-10 16:53:33 +02:00
|
|
|
},
|
2019-02-27 02:58:41 +01:00
|
|
|
|
2019-10-28 19:00:06 +01:00
|
|
|
showNeutralNotif(q: any, msg) {
|
2019-11-04 20:29:35 +01:00
|
|
|
tools.showNotif(q, msg, { color: 'info', icon: 'notifications' })
|
2019-10-28 19:00:06 +01:00
|
|
|
},
|
|
|
|
|
|
2020-01-30 01:20:23 +01:00
|
|
|
showNotif(q: any, msg, data ?: INotify | null, time?) {
|
2019-03-13 13:40:17 +01:00
|
|
|
let myicon = data ? data.icon : 'ion-add'
|
2019-03-21 20:43:15 +01:00
|
|
|
if (!myicon) {
|
2019-03-13 13:40:17 +01:00
|
|
|
myicon = 'ion-add'
|
2019-03-21 20:43:15 +01:00
|
|
|
}
|
2019-03-13 13:40:17 +01:00
|
|
|
let mycolor = data ? data.color : 'primary'
|
2019-03-21 20:43:15 +01:00
|
|
|
if (!mycolor) {
|
2019-03-13 13:40:17 +01:00
|
|
|
mycolor = 'primary'
|
2019-03-21 20:43:15 +01:00
|
|
|
}
|
2019-03-13 13:40:17 +01:00
|
|
|
q.notify({
|
|
|
|
|
message: msg,
|
|
|
|
|
icon: myicon,
|
|
|
|
|
classes: 'my-notif-class',
|
|
|
|
|
color: mycolor,
|
2020-01-30 01:20:23 +01:00
|
|
|
timeout: time || 4000
|
2019-03-13 13:40:17 +01:00
|
|
|
})
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-14 21:09:41 +01:00
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
isRegistered() {
|
|
|
|
|
return localStorage.getItem(tools.localStorage.userId) !== ''
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
checkIfUserExist(mythis) {
|
|
|
|
|
|
2019-10-10 16:53:33 +02:00
|
|
|
if (UserStore.getters.isUserInvalid) {
|
2019-03-22 20:51:42 +01:00
|
|
|
tools.showNotif(mythis.$q, mythis.$t('todo.usernotdefined'))
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!tools.isRegistered()) {
|
|
|
|
|
// Not logged
|
|
|
|
|
tools.showNotif(mythis.$q, mythis.$t('user.notregistered'))
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-03-14 21:09:41 +01:00
|
|
|
checkLangPassed(mylang) {
|
2020-05-10 21:06:42 +02:00
|
|
|
console.log('checkLangPassed ', mylang)
|
2019-03-14 21:09:41 +01:00
|
|
|
|
|
|
|
|
const mybrowserLang = Quasar.lang.isoName
|
|
|
|
|
|
|
|
|
|
if (mylang !== '') {
|
2020-05-10 21:06:42 +02:00
|
|
|
if ((mylang.toLowerCase() === 'enus') || (mylang.toLowerCase() === 'en-us') || (mylang.toLowerCase() === 'uk')
|
|
|
|
|
|| (mylang.toLowerCase() === 'uk-uk') || (mylang.toLowerCase() === 'en-uk') || (mylang.toLowerCase() === 'en-gb')
|
|
|
|
|
|| (mylang.toLowerCase() === 'gb-gb')) {
|
2019-03-14 21:09:41 +01:00
|
|
|
mylang = 'enUs'
|
|
|
|
|
}
|
|
|
|
|
if ((mylang.toLowerCase() === 'es') || (mylang.toLowerCase() === 'es-es') || (mylang.toLowerCase() === 'eses')) {
|
|
|
|
|
mylang = 'es'
|
|
|
|
|
}
|
2020-02-19 16:10:05 +01:00
|
|
|
if ((mylang.toLowerCase() === 'pt') || (mylang.toLowerCase() === 'pt-pt') || (mylang.toLowerCase() === 'ptpt')) {
|
|
|
|
|
mylang = 'pt'
|
|
|
|
|
}
|
2019-07-18 13:22:23 +02:00
|
|
|
if ((mylang.toLowerCase() === 'fr') || (mylang.toLowerCase() === 'fr-fr') || (mylang.toLowerCase() === 'frfr')) {
|
|
|
|
|
mylang = 'fr'
|
|
|
|
|
}
|
|
|
|
|
if ((mylang.toLowerCase() === 'it') || (mylang.toLowerCase() === 'it-it') || (mylang.toLowerCase() === 'itit')) {
|
|
|
|
|
mylang = 'it'
|
|
|
|
|
}
|
2020-03-31 20:34:49 +02:00
|
|
|
if ((mylang.toLowerCase() === 'si') || (mylang.toLowerCase() === 'si-si') || (mylang.toLowerCase() === 'sisi')) {
|
|
|
|
|
mylang = 'si'
|
|
|
|
|
}
|
2019-03-14 21:09:41 +01:00
|
|
|
|
2019-07-18 13:22:23 +02:00
|
|
|
if (!(static_data.arrLangUsed.includes(mylang))) {
|
2020-03-10 21:42:30 +01:00
|
|
|
// console.log('non incluso ', mylang)
|
2020-07-04 10:54:05 +02:00
|
|
|
// mylang = static_data.arrLangUsed[0]
|
|
|
|
|
mylang = 'enUs'
|
2019-03-14 21:09:41 +01:00
|
|
|
|
2019-10-10 16:53:33 +02:00
|
|
|
// Metti come default
|
2019-03-14 21:09:41 +01:00
|
|
|
UserStore.mutations.setlang(mylang)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!mylang) {
|
|
|
|
|
mylang = process.env.LANG_DEFAULT
|
2020-05-10 21:06:42 +02:00
|
|
|
console.log('LANG DEFAULT: ', mylang)
|
2019-03-14 21:09:41 +01:00
|
|
|
}
|
2019-07-12 14:09:44 +02:00
|
|
|
|
|
|
|
|
if (toolsext.getLocale(true) === '') {
|
|
|
|
|
UserStore.mutations.setlang(mylang)
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-23 20:44:06 +02:00
|
|
|
// console.log('mylang calc : ', mylang)
|
2019-03-14 21:09:41 +01:00
|
|
|
|
|
|
|
|
return mylang
|
2019-07-12 14:09:44 +02:00
|
|
|
},
|
2019-03-14 21:09:41 +01:00
|
|
|
|
2020-07-04 10:54:05 +02:00
|
|
|
getlang() {
|
|
|
|
|
return toolsext.getLocale()
|
|
|
|
|
},
|
|
|
|
|
|
2019-03-14 21:09:41 +01:00
|
|
|
getimglogo() {
|
|
|
|
|
return 'statics/images/' + process.env.LOGO_REG
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-21 20:43:15 +01:00
|
|
|
|
|
|
|
|
consolelogpao(strlog, strlog2 = '', strlog3 = '') {
|
|
|
|
|
globalroutines(null, 'log', strlog + ' ' + strlog2 + ' ' + strlog3, null)
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-21 20:43:15 +01:00
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
/*
|
|
|
|
|
get todos_vista() {
|
|
|
|
|
let mystr = ''
|
2019-03-28 12:58:34 +01:00
|
|
|
const arr = Todos.getters.items_dacompletare(this.categoryAtt)
|
2019-03-22 20:51:42 +01:00
|
|
|
for (const ind in arr) {
|
|
|
|
|
mystr += this.getstrelem(arr[ind]) + '\n'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return mystr + ''
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-05 23:59:52 +02:00
|
|
|
*/
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
public getArrTodos() {
|
|
|
|
|
|
|
|
|
|
let mystr = ''
|
|
|
|
|
|
|
|
|
|
return globalroutines(null, 'readall', 'todos', null)
|
|
|
|
|
.then((alldata) => {
|
|
|
|
|
const myrecs = [...alldata]
|
|
|
|
|
|
|
|
|
|
myrecs.forEach((rec) => {
|
|
|
|
|
mystr = mystr + rec.descr + rec.completed + '] ['
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// this.tmpstrTodos = 'TODOS: ' + mystr
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
2019-03-22 15:32:32 +01:00
|
|
|
aspettansec(numsec) {
|
2019-03-21 20:43:15 +01:00
|
|
|
return new Promise((resolve, reject) => {
|
2019-03-22 15:32:32 +01:00
|
|
|
setTimeout(() => {
|
|
|
|
|
resolve('anything')
|
|
|
|
|
}, numsec)
|
2019-03-21 20:43:15 +01:00
|
|
|
})
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-21 20:43:15 +01:00
|
|
|
|
2019-03-22 18:49:38 +01:00
|
|
|
dragula_option($service, dragname) {
|
|
|
|
|
$service.options(dragname,
|
|
|
|
|
{
|
|
|
|
|
moves(el, source, handle, sibling) {
|
|
|
|
|
return !el.classList.contains('donotdrag') // elements are always draggable by default
|
|
|
|
|
},
|
|
|
|
|
accepts(el, target, source, sibling) {
|
|
|
|
|
return true // elements can be dropped in any of the `containers` by default
|
|
|
|
|
},
|
|
|
|
|
invalid(el, handle) {
|
|
|
|
|
return el.classList.contains('donotdrag') // don't prevent any drags from initiating by default
|
|
|
|
|
},
|
|
|
|
|
direction: 'vertical'
|
|
|
|
|
})
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-22 18:49:38 +01:00
|
|
|
|
2019-04-05 23:59:52 +02:00
|
|
|
// _.cloneDeep( Per clonare un oggetto
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
isLoggedToSystem() {
|
|
|
|
|
const tok = tools.getItemLS(tools.localStorage.token)
|
|
|
|
|
return !!tok
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-30 02:57:40 +01:00
|
|
|
|
|
|
|
|
mapSort(linkedList) {
|
2019-07-10 11:37:00 +02:00
|
|
|
console.log('mapSort')
|
|
|
|
|
let sortedList = []
|
2019-03-30 02:57:40 +01:00
|
|
|
const map = new Map()
|
|
|
|
|
let currentId = null
|
|
|
|
|
|
|
|
|
|
// console.log('linkedList', linkedList)
|
|
|
|
|
|
|
|
|
|
// index the linked list by previous_item_id
|
|
|
|
|
for (let i = 0; i < linkedList.length; i++) {
|
|
|
|
|
const item = linkedList[i]
|
|
|
|
|
// tools.logelemprj(i, item)
|
|
|
|
|
if (item.id_prev === ApiTables.LIST_START) {
|
|
|
|
|
// first item
|
|
|
|
|
currentId = String(item._id)
|
|
|
|
|
// console.log('currentId', currentId);
|
|
|
|
|
sortedList.push(item)
|
|
|
|
|
} else {
|
|
|
|
|
map.set(item.id_prev, i)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-20 22:44:18 +02:00
|
|
|
// let i2 = 0
|
2019-03-30 02:57:40 +01:00
|
|
|
while (sortedList.length < linkedList.length) {
|
|
|
|
|
// get the item with a previous item ID referencing the current item
|
|
|
|
|
const nextItem = linkedList[map.get(currentId)]
|
|
|
|
|
if (nextItem === undefined) {
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
sortedList.push(nextItem)
|
|
|
|
|
// tools.logelemprj('FATTO:' + i, nextItem)
|
|
|
|
|
currentId = String(nextItem._id)
|
2019-10-20 22:44:18 +02:00
|
|
|
// i2++
|
2019-03-30 02:57:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sortedList.length < linkedList.length) {
|
|
|
|
|
console.log('!!!!! NON CI SONO TUTTI !!!!!', sortedList.length, linkedList.length)
|
|
|
|
|
// Forget something not in a List !
|
2019-04-22 01:43:53 +02:00
|
|
|
for (const itemlinked of linkedList) {
|
|
|
|
|
const elemtrov = sortedList.find((item) => item._id === itemlinked._id)
|
|
|
|
|
if (elemtrov === undefined) {
|
|
|
|
|
sortedList.push(itemlinked)
|
2019-03-30 02:57:40 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-10 11:37:00 +02:00
|
|
|
// Now Order by Priority
|
|
|
|
|
if (!!sortedList) {
|
|
|
|
|
if (sortedList.length > 0) {
|
|
|
|
|
if (sortedList[0].priority !== undefined) {
|
|
|
|
|
const sortednew = []
|
|
|
|
|
let myarr = []
|
|
|
|
|
for (const priorelem of lists.selectPriority.it) {
|
|
|
|
|
const myprior = priorelem.value
|
|
|
|
|
myarr = sortedList.filter((item) => item.priority === myprior)
|
|
|
|
|
if (myarr !== undefined)
|
|
|
|
|
sortednew.push(...myarr)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sortedList = sortednew
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// console.log('DOPO sortedList', sortedList)
|
2019-03-30 02:57:40 +01:00
|
|
|
|
|
|
|
|
return sortedList
|
2019-07-10 11:37:00 +02:00
|
|
|
},
|
2019-03-30 02:57:40 +01:00
|
|
|
|
|
|
|
|
getProgressClassColor(progress) {
|
|
|
|
|
if (progress > 66) {
|
|
|
|
|
return 'highperc'
|
|
|
|
|
} else if (progress > 33) {
|
|
|
|
|
return 'medperc'
|
|
|
|
|
} else {
|
|
|
|
|
return 'lowperc'
|
|
|
|
|
}
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-03-30 02:57:40 +01:00
|
|
|
|
|
|
|
|
getProgressColor(progress) {
|
|
|
|
|
if (progress > 66) {
|
|
|
|
|
return 'green'
|
|
|
|
|
} else if (progress > 33) {
|
|
|
|
|
return 'blue'
|
|
|
|
|
} else {
|
|
|
|
|
return 'red'
|
|
|
|
|
}
|
2019-10-23 23:47:12 +02:00
|
|
|
},
|
|
|
|
|
hasManyDays(mydatestart, mydateend) {
|
|
|
|
|
if (mydateend)
|
|
|
|
|
return tools.getstrDate(mydatestart) !== tools.getstrDate(mydateend)
|
|
|
|
|
else
|
|
|
|
|
return false
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
isManager() {
|
|
|
|
|
return UserStore.state.isManager
|
|
|
|
|
},
|
2019-04-02 00:18:01 +02:00
|
|
|
|
2020-07-04 10:54:05 +02:00
|
|
|
isAdmin() {
|
|
|
|
|
return UserStore.state.isAdmin
|
|
|
|
|
},
|
|
|
|
|
|
2020-04-07 14:33:56 +02:00
|
|
|
isTutor() {
|
|
|
|
|
return UserStore.state.isTutor
|
|
|
|
|
},
|
|
|
|
|
|
2020-09-04 00:08:36 +02:00
|
|
|
isZoomeri() {
|
|
|
|
|
return UserStore.state.isZoomeri
|
|
|
|
|
},
|
|
|
|
|
|
2020-05-10 21:06:42 +02:00
|
|
|
isTraduttrici() {
|
|
|
|
|
return UserStore.state.isTraduttrici
|
|
|
|
|
},
|
|
|
|
|
|
2019-04-02 00:18:01 +02:00
|
|
|
getstrDate(mytimestamp) {
|
2019-04-22 01:43:53 +02:00
|
|
|
// console.log('getstrDate', mytimestamp)
|
2019-04-05 16:16:29 +02:00
|
|
|
if (!!mytimestamp)
|
|
|
|
|
return date.formatDate(mytimestamp, 'DD/MM/YYYY')
|
|
|
|
|
else
|
|
|
|
|
return ''
|
2019-10-16 15:27:49 +02:00
|
|
|
},
|
|
|
|
|
|
2020-03-10 21:42:30 +01:00
|
|
|
getstrshortDate(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
|
|
|
|
return date.formatDate(mytimestamp, 'DD/MM')
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
|
2020-03-21 10:33:10 +01:00
|
|
|
getstrshortDateTime(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
|
|
|
|
return date.formatDate(mytimestamp, 'DD/MM HH:mm')
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
|
2020-05-10 21:06:42 +02:00
|
|
|
getstrshortDayDateTime(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
|
|
|
|
return date.formatDate(mytimestamp, 'DD HH:mm')
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-20 22:44:18 +02:00
|
|
|
getstrTime(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
|
|
|
|
return date.formatDate(mytimestamp, 'HH:mm')
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
|
2019-11-15 00:32:39 +01:00
|
|
|
getstrShortDate(mydate) {
|
|
|
|
|
const DateFormatter = new Intl.DateTimeFormat(func_tools.getLocale() || void 0, {
|
|
|
|
|
weekday: 'long',
|
|
|
|
|
day: 'numeric',
|
|
|
|
|
month: 'short',
|
|
|
|
|
year: 'numeric'
|
|
|
|
|
// timeZone: 'UTC'
|
|
|
|
|
})
|
|
|
|
|
try {
|
|
|
|
|
if (DateFormatter) {
|
|
|
|
|
const date1 = new Date(mydate)
|
|
|
|
|
return DateFormatter.format(date1)
|
|
|
|
|
}
|
|
|
|
|
return mydate
|
|
|
|
|
} catch (e) {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
getstrVeryShortDate(mydate) {
|
|
|
|
|
const DateFormatter = new Intl.DateTimeFormat(func_tools.getLocale() || void 0, {
|
|
|
|
|
weekday: 'short',
|
|
|
|
|
day: 'numeric',
|
|
|
|
|
month: 'short',
|
|
|
|
|
// timeZone: 'UTC'
|
|
|
|
|
})
|
|
|
|
|
try {
|
|
|
|
|
if (DateFormatter) {
|
|
|
|
|
const date1 = new Date(mydate)
|
|
|
|
|
return DateFormatter.format(date1)
|
|
|
|
|
}
|
|
|
|
|
return mydate
|
|
|
|
|
} catch (e) {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2019-11-17 22:24:41 +01:00
|
|
|
getstrVeryVeryShortDate(mydate) {
|
|
|
|
|
const DateFormatter = new Intl.DateTimeFormat(func_tools.getLocale() || void 0, {
|
|
|
|
|
weekday: 'long',
|
|
|
|
|
day: 'numeric',
|
|
|
|
|
// timeZone: 'UTC'
|
|
|
|
|
})
|
|
|
|
|
try {
|
|
|
|
|
if (DateFormatter) {
|
|
|
|
|
const date1 = new Date(mydate)
|
|
|
|
|
return DateFormatter.format(date1)
|
|
|
|
|
}
|
|
|
|
|
return mydate
|
|
|
|
|
} catch (e) {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
getstrDateTimeEvent(mythis, myevent, withhtml) {
|
|
|
|
|
let mystr = ''
|
|
|
|
|
// is same day?
|
|
|
|
|
if (tools.getstrDate(myevent.dateTimeStart) === tools.getstrDate(myevent.dateTimeEnd)) {
|
|
|
|
|
if (withhtml) {
|
|
|
|
|
mystr += `<span class="cal__where-content">${tools.getstrDate(myevent.dateTimeStart)}</span>
|
|
|
|
|
<span class="cal__hours-content">${mythis.$t('cal.starttime')} ${ tools.getstrTime(myevent.dateTimeStart) }
|
|
|
|
|
${ mythis.$t('cal.endtime')} ${ tools.getstrTime(myevent.dateTimeEnd) }`
|
|
|
|
|
} else {
|
|
|
|
|
mystr = `${tools.getstrDate(myevent.dateTimeStart)}
|
2020-09-04 00:08:36 +02:00
|
|
|
${mythis.$t('cal.starttime')} ${ tools.getstrTime(myevent.dateTimeStart) }
|
2019-11-01 19:58:52 +01:00
|
|
|
${ mythis.$t('cal.endtime')} ${ tools.getstrTime(myevent.dateTimeEnd) }`
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
mystr = `<span class="cal__where-content">${tools.getstrDate(myevent.dateTimeStart)}</span>
|
|
|
|
|
<span class="cal__hours-content">${mythis.$t('cal.starttime')} ${ tools.getstrTime(myevent.dateTimeStart) } </span>
|
|
|
|
|
${ mythis.$t('cal.enddate')} ${tools.getstrDate(myevent.dateTimeEnd)}
|
2019-11-08 23:43:00 +01:00
|
|
|
<span class="cal__hours-content">${ mythis.$t('cal.endtime')} ${ tools.getstrTime(myevent.dateTimeEnd) } </span>`
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (myevent.infoextra) {
|
|
|
|
|
mystr += `<span class="cal__hours">
|
|
|
|
|
<span class="cal__hours-title">${mythis.$t('cal.hours')}: </span>
|
|
|
|
|
<span class="cal__hours-content">${ myevent.infoextra } </span>
|
|
|
|
|
</span>
|
|
|
|
|
</span>`
|
|
|
|
|
}
|
|
|
|
|
return mystr
|
|
|
|
|
},
|
|
|
|
|
|
2019-11-15 00:32:39 +01:00
|
|
|
getstrDateTimeEventSimple(mythis, myevent) {
|
|
|
|
|
let mystr = ''
|
|
|
|
|
// is same day?
|
|
|
|
|
if (tools.getstrShortDate(myevent.dateTimeStart) === tools.getstrShortDate(myevent.dateTimeEnd)) {
|
|
|
|
|
mystr = `${tools.getstrShortDate(myevent.dateTimeStart)}
|
2019-11-17 22:24:41 +01:00
|
|
|
- ${ tools.getstrTime(myevent.dateTimeStart) }`
|
2019-11-15 00:32:39 +01:00
|
|
|
} else {
|
2019-11-17 22:24:41 +01:00
|
|
|
mystr = `${tools.getstrVeryVeryShortDate(myevent.dateTimeStart)} - ${ tools.getstrShortDate(myevent.dateTimeEnd) }`
|
2019-11-15 00:32:39 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return mystr
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getstrDateTimeEventShort(mythis, myevent) {
|
|
|
|
|
let mystr = ''
|
|
|
|
|
// is same day?
|
|
|
|
|
if (tools.getstrShortDate(myevent.dateTimeStart) === tools.getstrShortDate(myevent.dateTimeEnd)) {
|
|
|
|
|
mystr = `${tools.getstrVeryShortDate(myevent.dateTimeStart)}
|
|
|
|
|
h. ${ tools.getstrTime(myevent.dateTimeStart) }`
|
|
|
|
|
} else {
|
|
|
|
|
mystr = `${tools.getstrVeryShortDate(myevent.dateTimeStart)} - ${ tools.getstrVeryShortDate(myevent.dateTimeEnd) }`
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return mystr
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-16 15:27:49 +02:00
|
|
|
getstrDateTime(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
2019-10-20 22:44:18 +02:00
|
|
|
return date.formatDate(mytimestamp, 'DD/MM/YYYY HH:mm')
|
2019-10-16 15:27:49 +02:00
|
|
|
else
|
|
|
|
|
return ''
|
2019-10-25 19:07:56 +02:00
|
|
|
},
|
|
|
|
|
|
2019-12-04 02:04:54 +01:00
|
|
|
getstrDateTimeAll(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
|
|
|
|
return date.formatDate(mytimestamp, 'DD/MM/YYYY HH:mm:ss')
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getstrTimeAll(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
|
|
|
|
return date.formatDate(mytimestamp, 'HH:mm:ss')
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-25 19:07:56 +02:00
|
|
|
getstrDateTimeShort(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
2020-01-27 15:09:11 +01:00
|
|
|
return date.formatDate(mytimestamp, 'DD/MM HH:mm')
|
2020-01-21 01:38:28 +01:00
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getstrDateMonthTimeShort(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
|
|
|
|
return date.formatDate(mytimestamp, 'DD MMM HH:mm')
|
2019-10-25 19:07:56 +02:00
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
2019-10-23 23:47:12 +02:00
|
|
|
|
2020-02-19 16:10:05 +01:00
|
|
|
getstrDateMonthWeekTimeShort(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
|
|
|
|
return this.getDayOfWeek(mytimestamp) + ' ' + date.formatDate(mytimestamp, 'DD MMM - HH:mm')
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-23 23:47:12 +02:00
|
|
|
getstrDateEmailTime(mythis, mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
2019-10-24 23:30:18 +02:00
|
|
|
return date.formatDate(mytimestamp, 'DD/MM/YYYY') + ' ' + mythis.$t('cal.starttime') + ' ' + date.formatDate(mytimestamp, 'HH:mm')
|
2019-10-23 23:47:12 +02:00
|
|
|
else
|
|
|
|
|
return ''
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-23 20:44:06 +02:00
|
|
|
getstrMMMDate(mytimestamp) {
|
|
|
|
|
// console.log('getstrDate', mytimestamp)
|
|
|
|
|
if (!!mytimestamp)
|
|
|
|
|
return date.formatDate(mytimestamp, 'DD MMM YYYY')
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
,
|
2019-04-05 16:16:29 +02:00
|
|
|
getstrYYMMDDDate(mytimestamp) {
|
|
|
|
|
return date.formatDate(mytimestamp, 'YYYY-MM-DD')
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-10-21 20:38:22 +02:00
|
|
|
getstrYYMMDDDateTime(mytimestamp) {
|
|
|
|
|
return date.formatDate(mytimestamp, 'YYYY-MM-DD HH:mm')
|
2019-10-26 02:21:14 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getstrYYMMDDDateTimeAll(mytimestamp) {
|
|
|
|
|
return date.formatDate(mytimestamp, 'YYYY-MM-DD HH:mm:ss')
|
|
|
|
|
},
|
2019-04-05 16:16:29 +02:00
|
|
|
|
2020-06-08 13:31:44 +02:00
|
|
|
gettimestampstrDate(mydatestr) {
|
|
|
|
|
if (!!mydatestr) {
|
|
|
|
|
let mydate = new Date(mydatestr)
|
|
|
|
|
if (!!mydate)
|
|
|
|
|
return mydate.getTime()
|
|
|
|
|
}
|
|
|
|
|
return 0
|
|
|
|
|
},
|
|
|
|
|
|
2019-04-05 23:59:52 +02:00
|
|
|
// mystrdate "26.04.2013"
|
2019-11-01 19:58:52 +01:00
|
|
|
convertstrtoDate(mystrdate: string) {
|
2019-04-05 16:16:29 +02:00
|
|
|
if (mystrdate.length < 10) {
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const pattern = /(\d{2})\/(\d{2})\/(\d{4})/
|
|
|
|
|
const strdate = mystrdate.replace(pattern, '$3-$2-$1')
|
|
|
|
|
let mydate = null
|
|
|
|
|
if (date.isValid(strdate)) {
|
|
|
|
|
mydate = new Date(strdate)
|
|
|
|
|
} else {
|
|
|
|
|
return null
|
|
|
|
|
}
|
2019-11-15 00:32:39 +01:00
|
|
|
// console.log('mystrdate', mystrdate, strdate, mydate)
|
2019-04-05 16:16:29 +02:00
|
|
|
return mydate
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-04-02 00:18:01 +02:00
|
|
|
|
2019-04-03 02:48:05 +02:00
|
|
|
capitalize(value) {
|
|
|
|
|
if (!value) {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
value = value.toString()
|
|
|
|
|
return value.charAt(0).toUpperCase() + value.slice(1)
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-04-05 16:16:29 +02:00
|
|
|
|
2019-07-10 11:37:00 +02:00
|
|
|
firstchars(value, numchars = 200) {
|
|
|
|
|
if (!value) {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
2019-10-20 01:22:38 +02:00
|
|
|
try {
|
2019-10-20 22:44:18 +02:00
|
|
|
let mycar = value.substring(0, numchars)
|
|
|
|
|
if (value.length > numchars)
|
|
|
|
|
mycar += '...'
|
|
|
|
|
return mycar
|
|
|
|
|
} catch (e) {
|
2019-10-20 01:22:38 +02:00
|
|
|
return value
|
|
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
2020-01-20 01:50:21 +01:00
|
|
|
firstchars_onedot(value, numchars = 200) {
|
|
|
|
|
if (!value) {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
let mycar = value.substring(0, numchars)
|
|
|
|
|
if (value.length > numchars)
|
|
|
|
|
mycar += '.'
|
|
|
|
|
return mycar
|
|
|
|
|
} catch (e) {
|
|
|
|
|
return value
|
|
|
|
|
}
|
2020-03-21 10:33:10 +01:00
|
|
|
},
|
2020-01-20 01:50:21 +01:00
|
|
|
|
2019-04-05 16:16:29 +02:00
|
|
|
getDateNow() {
|
|
|
|
|
const mydate = new Date()
|
|
|
|
|
return mydate
|
2019-11-15 00:32:39 +01:00
|
|
|
},
|
2020-02-19 16:10:05 +01:00
|
|
|
|
2020-03-21 10:33:10 +01:00
|
|
|
isDateArrived(mydate) {
|
|
|
|
|
const datenow = tools.getDateNow()
|
|
|
|
|
const diff = date.getDateDiff(datenow, mydate)
|
|
|
|
|
// console.log('diff = ' + diff)
|
2020-04-07 14:33:56 +02:00
|
|
|
if (diff >= -1) {
|
2020-03-21 10:33:10 +01:00
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-19 16:10:05 +01:00
|
|
|
getDayOfWeek(date) {
|
|
|
|
|
const dayOfWeek = new Date(date).getDay()
|
|
|
|
|
|
|
|
|
|
let lang = this.getLocale()
|
|
|
|
|
|
|
|
|
|
const myday = {
|
|
|
|
|
it: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'],
|
|
|
|
|
enUs: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
|
|
|
|
fr: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
|
2020-05-14 17:23:03 +02:00
|
|
|
es: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
|
2020-02-19 16:10:05 +01:00
|
|
|
pt: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'],
|
|
|
|
|
de: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
|
2020-03-31 20:34:49 +02:00
|
|
|
si: ['Nedelja', 'Ponedeljek', 'Torek', 'Sreda', 'četrtek', 'Petek', 'Sobota'],
|
2020-02-19 16:10:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return isNaN(dayOfWeek) ? '' : myday[lang][dayOfWeek].substring(0, 3)
|
|
|
|
|
},
|
|
|
|
|
|
2019-11-15 00:32:39 +01:00
|
|
|
getDateNowEvent() {
|
|
|
|
|
return tools.addDays(tools.getDateNow(), -1)
|
|
|
|
|
},
|
2019-04-05 16:16:29 +02:00
|
|
|
getDateNull() {
|
2019-04-05 23:59:52 +02:00
|
|
|
return new Date(0)
|
|
|
|
|
}
|
|
|
|
|
,
|
2019-04-05 16:16:29 +02:00
|
|
|
getTimeNow() {
|
|
|
|
|
return new Date().getTime()
|
2019-04-05 23:59:52 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-04-05 16:16:29 +02:00
|
|
|
getTimestampsNow() {
|
|
|
|
|
return new Date().valueOf()
|
2019-10-26 02:21:14 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
gettimestampByDate(mydate) {
|
|
|
|
|
return mydate.toString()
|
|
|
|
|
},
|
2019-04-07 21:24:10 +02:00
|
|
|
|
2019-04-09 21:07:16 +02:00
|
|
|
isMainProject(idproj) {
|
|
|
|
|
return idproj === process.env.PROJECT_ID_MAIN
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-04-22 01:43:53 +02:00
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
getUrlByTipoProj(tipoproj, name ?: string) {
|
2019-04-25 00:30:13 +02:00
|
|
|
if (!!name)
|
|
|
|
|
return '/' + name + '/'
|
2019-04-22 01:43:53 +02:00
|
|
|
else
|
2019-04-29 02:47:53 +02:00
|
|
|
return '/' + tipoproj + '/'
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-04-25 00:30:13 +02:00
|
|
|
|
2019-07-18 13:22:23 +02:00
|
|
|
// convertMenuListInListRoutes(arrlista: IMenuList[]) {
|
|
|
|
|
// const lista = []
|
|
|
|
|
// if (arrlista === undefined)
|
|
|
|
|
// return lista
|
|
|
|
|
// for (const elem of arrlista) {
|
|
|
|
|
// const item: IListRoutes = {
|
|
|
|
|
// faIcon: 'fa fa-list-alt',
|
|
|
|
|
// materialIcon: elem.icon,
|
|
|
|
|
// name: elem.nametranslate,
|
|
|
|
|
// text: elem.description,
|
|
|
|
|
// path: tools.getUrlByTipoProj(false, elem.urlroute) + elem.idelem,
|
|
|
|
|
// routes2: tools.convertMenuListInListRoutes(elem.routes2),
|
|
|
|
|
// level_parent: elem.level_parent,
|
|
|
|
|
// level_child: elem.level_child
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// lista.push(item)
|
|
|
|
|
// }
|
|
|
|
|
// return lista
|
|
|
|
|
// },
|
2019-04-09 21:07:16 +02:00
|
|
|
|
2019-04-29 02:47:53 +02:00
|
|
|
getprivacyreadbytipoproj(tipoproj) {
|
|
|
|
|
if (tipoproj === RouteNames.myprojects)
|
|
|
|
|
return Privacy.onlyme
|
|
|
|
|
else
|
|
|
|
|
return Privacy.all
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-04-29 02:47:53 +02:00
|
|
|
|
|
|
|
|
getprivacywritebytipoproj(tipoproj) {
|
|
|
|
|
return Privacy.onlyme
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-05-02 16:58:36 +02:00
|
|
|
|
|
|
|
|
addRoute(myarr, values) {
|
|
|
|
|
myarr.push(values)
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-05-03 20:31:47 +02:00
|
|
|
displayConfirmNotification() {
|
|
|
|
|
let options = null
|
|
|
|
|
if ('serviceWorker' in navigator) {
|
|
|
|
|
options = {
|
|
|
|
|
body: 'You successfully subscribed to our Notification service!',
|
|
|
|
|
icon: '/statics/icons/app-icon-96x96.png',
|
|
|
|
|
image: '/statics/images/sf-boat.jpg',
|
|
|
|
|
dir: 'ltr',
|
|
|
|
|
lang: 'enUs', // BCP 47,
|
|
|
|
|
vibrate: [100, 50, 200],
|
|
|
|
|
badge: '/statics/icons/app-icon-96x96.png',
|
|
|
|
|
tag: 'confirm-notification',
|
|
|
|
|
renotify: true, // if it's already sent, will Vibrate anyway
|
|
|
|
|
actions: [
|
|
|
|
|
{ action: 'confirm', title: 'Okay', icon: '/statics/icons/app-icon-96x96.png' },
|
|
|
|
|
{ action: 'cancel', title: 'Cancel', icon: '/statics/icons/app-icon-96x96.png' }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ('serviceWorker' in navigator) {
|
|
|
|
|
navigator.serviceWorker.ready
|
2019-07-10 11:37:00 +02:00
|
|
|
.then((swreg) => {
|
2019-05-03 20:31:47 +02:00
|
|
|
swreg.showNotification('Successfully subscribed!', options)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-05-03 20:31:47 +02:00
|
|
|
|
|
|
|
|
dataURItoBlob(dataURI) {
|
|
|
|
|
const byteString = atob(dataURI.split(',')[1])
|
|
|
|
|
const mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
|
|
|
|
|
const ab = new ArrayBuffer(byteString.length)
|
|
|
|
|
const ia = new Uint8Array(ab)
|
|
|
|
|
for (let i = 0; i < byteString.length; i++) {
|
|
|
|
|
ia[i] = byteString.charCodeAt(i)
|
|
|
|
|
}
|
|
|
|
|
const blob = new Blob([ab], { type: mimeString })
|
|
|
|
|
return blob
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-05-03 20:31:47 +02:00
|
|
|
|
|
|
|
|
showNotificationExample() {
|
|
|
|
|
let options = null
|
|
|
|
|
const mythis = this
|
|
|
|
|
if ('serviceWorker' in navigator) {
|
|
|
|
|
options = {
|
|
|
|
|
body: mythis.$t('notification.subscribed'),
|
|
|
|
|
icon: '/statics/icons/android-chrome-192x192.png',
|
|
|
|
|
image: '/statics/images/imglogonotif.png',
|
|
|
|
|
dir: 'ltr',
|
|
|
|
|
lang: 'enUs', // BCP 47,
|
|
|
|
|
vibrate: [100, 50, 200],
|
|
|
|
|
badge: '/statics/icons/android-chrome-192x192.png',
|
|
|
|
|
tag: 'confirm-notification',
|
|
|
|
|
renotify: true, // if it's already sent, will Vibrate anyway
|
|
|
|
|
actions: [
|
|
|
|
|
{ action: 'confirm', title: mythis.$t('dialog.ok'), icon: '/statics/icons/android-chrome-192x192.png' }
|
|
|
|
|
// { action: 'cancel', title: 'Cancel', icon: '/statics/icons/android-chrome-192x192.png', }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
navigator.serviceWorker.ready
|
2019-07-10 11:37:00 +02:00
|
|
|
.then((swreg) => {
|
2019-05-03 20:31:47 +02:00
|
|
|
swreg.showNotification('aaa', options)
|
|
|
|
|
})
|
|
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-05-03 20:31:47 +02:00
|
|
|
|
2019-07-10 11:37:00 +02:00
|
|
|
getemailto(text) {
|
|
|
|
|
return 'mailto:' + text
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
2020-05-10 21:06:42 +02:00
|
|
|
askfornotification(mythis) {
|
|
|
|
|
console.log('askfornotification')
|
|
|
|
|
tools.showNotif(mythis.$q, mythis.$t('notification.waitingconfirm'), { color: 'positive', icon: 'notifications' })
|
2019-04-29 02:47:53 +02:00
|
|
|
|
2019-05-03 20:31:47 +02:00
|
|
|
Notification.requestPermission((result) => {
|
|
|
|
|
console.log('User Choice', result)
|
|
|
|
|
if (result === 'granted') {
|
2020-05-10 21:06:42 +02:00
|
|
|
tools.showNotif(mythis.$q, mythis.$t('notification.confirmed'), { color: 'positive', icon: 'notifications' })
|
2019-05-03 20:31:47 +02:00
|
|
|
} else {
|
2020-05-10 21:06:42 +02:00
|
|
|
tools.showNotif(mythis.$q, mythis.$t('notification.denied'), { color: 'negative', icon: 'notifications' })
|
2019-05-03 20:31:47 +02:00
|
|
|
|
|
|
|
|
// displayConfirmNotification();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
2019-12-27 12:43:42 +01:00
|
|
|
heightgallery(coeff) {
|
2019-12-29 01:54:00 +01:00
|
|
|
// console.log('heightgallery')
|
2019-12-27 12:43:42 +01:00
|
|
|
return tools.heightGallVal(coeff).toString() + 'px'
|
2020-01-13 23:53:27 +01:00
|
|
|
},
|
2019-10-16 15:27:49 +02:00
|
|
|
|
2019-12-27 12:43:42 +01:00
|
|
|
heightGallVal(coeff = 1.33) {
|
2019-10-16 15:27:49 +02:00
|
|
|
let maxh2 = 0
|
|
|
|
|
|
2019-12-27 12:43:42 +01:00
|
|
|
let myw = Screen.width
|
|
|
|
|
if (!this.isMobile())
|
|
|
|
|
if (GlobalStore.state.leftDrawerOpen)
|
|
|
|
|
myw -= 300
|
|
|
|
|
if (!this.isMobile())
|
|
|
|
|
if (GlobalStore.state.RightDrawerOpen)
|
|
|
|
|
myw -= 300
|
|
|
|
|
|
|
|
|
|
maxh2 = (myw / coeff) + 20
|
2020-01-13 23:53:27 +01:00
|
|
|
if (maxh2 > 500)
|
|
|
|
|
maxh2 = 500
|
2019-10-16 15:27:49 +02:00
|
|
|
|
|
|
|
|
return maxh2
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
myheight_imgtitle(myheight ?, myheightmobile ?) {
|
2019-09-19 22:56:19 +02:00
|
|
|
let maxheight = 0
|
2019-09-12 16:19:23 +02:00
|
|
|
if (!!myheight) {
|
2019-09-19 22:56:19 +02:00
|
|
|
maxheight = myheight
|
|
|
|
|
if (myheight > 0) {
|
|
|
|
|
if (myheight > 1000) {
|
|
|
|
|
maxheight = 1000
|
|
|
|
|
} else {
|
2019-10-10 16:53:33 +02:00
|
|
|
maxheight = parseInt(myheight, 10)
|
2019-09-19 22:56:19 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
maxheight = 500
|
2019-09-12 16:19:23 +02:00
|
|
|
}
|
2019-09-19 22:56:19 +02:00
|
|
|
|
2019-10-16 15:27:49 +02:00
|
|
|
const maxh2 = this.heightGallVal()
|
2019-09-19 22:56:19 +02:00
|
|
|
|
2019-10-20 01:22:38 +02:00
|
|
|
// console.log('maxh2', maxh2)
|
|
|
|
|
// console.log('maxheight', maxheight)
|
2019-09-19 22:56:19 +02:00
|
|
|
|
|
|
|
|
let ris = 0
|
|
|
|
|
|
|
|
|
|
if (maxh2 < maxheight)
|
|
|
|
|
ris = maxh2
|
|
|
|
|
else
|
|
|
|
|
ris = maxheight
|
|
|
|
|
|
|
|
|
|
if (!!myheightmobile) {
|
|
|
|
|
if (this.isMobile() && maxh2 > myheightmobile)
|
|
|
|
|
ris = parseInt(myheightmobile, 10)
|
2019-07-10 11:37:00 +02:00
|
|
|
}
|
2019-09-19 22:56:19 +02:00
|
|
|
|
2019-10-20 01:22:38 +02:00
|
|
|
// console.log('ris', ris)
|
2019-09-19 22:56:19 +02:00
|
|
|
return ris
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
|
|
|
|
myheight_dialog() {
|
2019-12-27 12:43:42 +01:00
|
|
|
if (Screen.width < 410) {
|
2019-10-23 23:47:12 +02:00
|
|
|
return '337'
|
2019-07-10 11:37:00 +02:00
|
|
|
} else if (Screen.width < 600) {
|
2020-05-11 22:43:54 +02:00
|
|
|
return '450'
|
|
|
|
|
} else if (Screen.width < 800) {
|
2019-07-10 11:37:00 +02:00
|
|
|
return '500'
|
2020-05-11 22:43:54 +02:00
|
|
|
} else if (Screen.width < 900) {
|
|
|
|
|
return '700'
|
2020-06-08 13:31:44 +02:00
|
|
|
} else if (Screen.width < 1000) {
|
|
|
|
|
return '900'
|
|
|
|
|
} else if (Screen.width < 1100) {
|
|
|
|
|
return '1000'
|
|
|
|
|
} else {
|
|
|
|
|
return Screen.width - 200
|
2019-07-10 11:37:00 +02:00
|
|
|
}
|
2019-11-15 00:32:39 +01:00
|
|
|
},
|
2019-07-10 11:37:00 +02:00
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
styles_imgtitle(sized ?: string) {
|
2019-09-19 22:56:19 +02:00
|
|
|
if (!!sized) {
|
|
|
|
|
return sized
|
2019-07-10 11:37:00 +02:00
|
|
|
} else {
|
2019-12-27 12:43:42 +01:00
|
|
|
if (Screen.width < 410) {
|
2019-09-19 22:56:19 +02:00
|
|
|
return 'max-height: 250px'
|
|
|
|
|
} else {
|
|
|
|
|
return 'max-height: 350px'
|
|
|
|
|
}
|
2019-07-10 11:37:00 +02:00
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
<q-img
|
|
|
|
|
src="https://cdn.quasar.dev/img/image-src.png"
|
|
|
|
|
srcset="https://cdn.quasar.dev/img/image-1x.png 400w,
|
|
|
|
|
https://cdn.quasar.dev/img/image-2x.png 800w,
|
|
|
|
|
https://cdn.quasar.dev/img/image-3x.png 1200w,
|
|
|
|
|
https://cdn.quasar.dev/img/image-4x.png 1600w"
|
|
|
|
|
sizes="(max-width: 400px) 400w,
|
|
|
|
|
(min-width: 400px) and (max-width: 800px) 800w,
|
|
|
|
|
(min-width: 800px) and (max-width: 1200px) 1200w,
|
|
|
|
|
(min-width: 1200px) 1600w"
|
|
|
|
|
style="height: 280px; max-width: 300px"
|
|
|
|
|
>
|
|
|
|
|
<div class="absolute-bottom text-body1 text-center">
|
|
|
|
|
With srcset & sizes
|
|
|
|
|
</div>
|
|
|
|
|
</q-img>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
getsizes() {
|
|
|
|
|
return '(max-width: 400px) 400w, ' +
|
|
|
|
|
'(min-width: 400px) and (max-width: 800px) 800w, ' +
|
|
|
|
|
'(min-width: 800px) and (max-width: 1200px) 1200w, ' +
|
|
|
|
|
'(min-width: 1200px) 1600w'
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
|
|
|
|
maxwidth_imgtitle() {
|
2019-12-27 12:43:42 +01:00
|
|
|
if (Screen.width < 410) {
|
2019-07-10 11:37:00 +02:00
|
|
|
return 'max-width: 250px'
|
|
|
|
|
} else {
|
|
|
|
|
return 'max-width: 350px'
|
|
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
2019-09-19 22:56:19 +02:00
|
|
|
isMobile() {
|
2019-12-27 12:43:42 +01:00
|
|
|
return (Screen.width < 450)
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-09-19 22:56:19 +02:00
|
|
|
|
2019-07-10 11:37:00 +02:00
|
|
|
mywidth_imgtitle() {
|
2019-12-27 12:43:42 +01:00
|
|
|
if (Screen.width < 450) {
|
2019-07-10 11:37:00 +02:00
|
|
|
return '250'
|
|
|
|
|
} else if (Screen.width < 600) {
|
|
|
|
|
return '350'
|
|
|
|
|
} else {
|
|
|
|
|
return '350'
|
|
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
|
|
|
|
mymargin_imgtitle() {
|
|
|
|
|
return 'auto'
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
|
|
|
|
showthumbnails() {
|
2019-12-27 12:43:42 +01:00
|
|
|
if (Screen.width < 410) {
|
2019-07-10 11:37:00 +02:00
|
|
|
return false
|
|
|
|
|
} else if (Screen.width < 600) {
|
|
|
|
|
return true
|
|
|
|
|
} else {
|
|
|
|
|
return true
|
|
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
|
|
|
|
padTime(val) {
|
|
|
|
|
val = Math.floor(val)
|
|
|
|
|
if (val < 10) {
|
|
|
|
|
return '0' + val
|
|
|
|
|
}
|
|
|
|
|
return val + ''
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
getLocale(vero ?: boolean) {
|
2019-07-12 14:09:44 +02:00
|
|
|
if (UserStore) {
|
|
|
|
|
if (UserStore.state) {
|
|
|
|
|
return UserStore.state.lang
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!vero)
|
|
|
|
|
return process.env.LANG_DEFAULT
|
|
|
|
|
else
|
|
|
|
|
return ''
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
2019-07-12 14:09:44 +02:00
|
|
|
addDays(mydate, days) {
|
|
|
|
|
return date.addToDate(mydate, { days })
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-09-12 16:19:23 +02:00
|
|
|
|
2019-10-23 23:47:12 +02:00
|
|
|
addMinutes(mydate, minutes) {
|
|
|
|
|
return date.addToDate(mydate, { minutes })
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-10-23 23:47:12 +02:00
|
|
|
|
2019-09-12 16:19:23 +02:00
|
|
|
gettitlemain(datamain: ITimeLineMain) {
|
|
|
|
|
if (datamain.titlemain[toolsext.getLocale()])
|
|
|
|
|
return datamain.titlemain[toolsext.getLocale()]
|
|
|
|
|
else {
|
|
|
|
|
return datamain.titlemain[static_data.arrLangUsed[0]]
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-09-12 16:19:23 +02:00
|
|
|
getwwithwhocoll(datamain: ICollaborations) {
|
|
|
|
|
if (datamain.withwhom_title[toolsext.getLocale()])
|
|
|
|
|
return datamain.withwhom_title[toolsext.getLocale()]
|
|
|
|
|
else {
|
|
|
|
|
return datamain.withwhom_title[static_data.arrLangUsed[0]]
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-09-12 16:19:23 +02:00
|
|
|
gettextcoll(data: IColl) {
|
|
|
|
|
if (data.subtitle[toolsext.getLocale()])
|
|
|
|
|
return data.subtitle[toolsext.getLocale()]
|
|
|
|
|
else {
|
|
|
|
|
return data.subtitle[static_data.arrLangUsed[0]]
|
|
|
|
|
}
|
2020-06-08 13:31:44 +02:00
|
|
|
},
|
2019-09-12 16:19:23 +02:00
|
|
|
gettitlecoll(data: IColl) {
|
|
|
|
|
if (data.title[toolsext.getLocale()])
|
|
|
|
|
return data.title[toolsext.getLocale()]
|
|
|
|
|
else {
|
|
|
|
|
return data.title[static_data.arrLangUsed[0]]
|
|
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
gettextdescr(data: ITimeLineEntry, numdescr = 'description'
|
|
|
|
|
) {
|
2019-09-12 16:19:23 +02:00
|
|
|
if (!!data[numdescr]) {
|
|
|
|
|
if (data[numdescr][toolsext.getLocale()])
|
|
|
|
|
return data[numdescr][toolsext.getLocale()]
|
|
|
|
|
else {
|
|
|
|
|
return data[numdescr][static_data.arrLangUsed[0]]
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-09-12 16:19:23 +02:00
|
|
|
|
|
|
|
|
getlink(data: ITimeLineEntry) {
|
|
|
|
|
if (data.link_text[toolsext.getLocale()])
|
|
|
|
|
return data.link_text[toolsext.getLocale()]
|
|
|
|
|
else {
|
|
|
|
|
return data.link_text[static_data.arrLangUsed[0]]
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-04 10:54:05 +02:00
|
|
|
},
|
2019-09-12 16:19:23 +02:00
|
|
|
|
|
|
|
|
getlinkurl(data: ITimeLineEntry) {
|
|
|
|
|
if (data.link_url_lang) {
|
|
|
|
|
if (data.link_url_lang[toolsext.getLocale()]) {
|
|
|
|
|
return data.link_url_lang[toolsext.getLocale()]
|
|
|
|
|
} else {
|
|
|
|
|
return data.link_url
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return data.link_url
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
appid() {
|
|
|
|
|
return process.env.APP_ID
|
2019-09-19 22:56:19 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getLabelByItem(item, mythis) {
|
|
|
|
|
if (!!item.name)
|
|
|
|
|
return mythis.$t(item.name)
|
|
|
|
|
else
|
|
|
|
|
return item.text
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2019-11-15 00:32:39 +01:00
|
|
|
getimgev(ev) {
|
|
|
|
|
if (!!ev.img_small)
|
|
|
|
|
return `statics/` + ev.img_small
|
|
|
|
|
else if (!!ev.img)
|
|
|
|
|
return `statics/` + ev.img
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
|
2019-09-19 22:56:19 +02:00
|
|
|
getimgbysize(dir: string, file: string) {
|
|
|
|
|
const myimage = dir + file
|
2019-09-20 15:35:55 +02:00
|
|
|
// console.log('includes = ', static_data.preLoadImages.map((a) => a.imgname).includes(myimage), myimage)
|
2019-09-19 22:56:19 +02:00
|
|
|
let ris = ''
|
2019-12-27 12:43:42 +01:00
|
|
|
if (this.isMobile() && (preloadedimages().map((a) => a.imgname).includes(myimage))) {
|
2019-09-19 22:56:19 +02:00
|
|
|
ris = dir + 'mobile/' + file
|
|
|
|
|
} else {
|
|
|
|
|
ris = myimage
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-20 15:35:55 +02:00
|
|
|
// console.log('getimgbysize', ris)
|
2019-09-19 22:56:19 +02:00
|
|
|
|
|
|
|
|
return ris
|
|
|
|
|
},
|
|
|
|
|
|
2019-11-20 00:15:08 +01:00
|
|
|
getaltimg(dir: string, file: string, alt?: string) {
|
|
|
|
|
const myimage = dir + file
|
|
|
|
|
const myrec = static_data.preLoadImages.find((rec) => rec.imgname === myimage)
|
|
|
|
|
if (myrec)
|
|
|
|
|
return (myrec) ? myrec.alt : 'my image'
|
|
|
|
|
else
|
|
|
|
|
return alt
|
|
|
|
|
},
|
|
|
|
|
|
2019-09-19 22:56:19 +02:00
|
|
|
getimgFullpathbysize(fileimg: string) {
|
2020-01-13 23:53:27 +01:00
|
|
|
if (!fileimg)
|
|
|
|
|
return { path: '', file: fileimg }
|
2019-09-19 22:56:19 +02:00
|
|
|
const ind = fileimg.lastIndexOf('/')
|
|
|
|
|
if (ind > 0) {
|
2019-10-10 16:53:33 +02:00
|
|
|
return { path: fileimg.substring(0, ind + 1), file: fileimg.substring(ind + 1) }
|
2019-09-19 22:56:19 +02:00
|
|
|
} else {
|
|
|
|
|
return { path: '', file: fileimg }
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-07-10 11:37:00 +02:00
|
|
|
|
2019-10-10 16:53:33 +02:00
|
|
|
convertHTMLtoText(myhtml) {
|
|
|
|
|
let msg = myhtml
|
|
|
|
|
msg = msg.replace('"', '"')
|
|
|
|
|
msg = msg.replace('>', '>')
|
|
|
|
|
msg = msg.replace('<', '<')
|
|
|
|
|
msg = msg.replace('&', '&')
|
|
|
|
|
msg = msg.replace('<br>', '\n')
|
2019-09-12 16:19:23 +02:00
|
|
|
|
2019-10-10 16:53:33 +02:00
|
|
|
return msg
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-10-23 23:47:12 +02:00
|
|
|
gettextevent(mythis, myevent: IEvents) {
|
2019-10-20 22:44:18 +02:00
|
|
|
// return '"' + myevent.title + '" (' + func_tools.getDateStr(myevent.date) + ') - ' + myevent.time
|
2019-10-23 23:47:12 +02:00
|
|
|
return '"' + myevent.title + '" (' + tools.getstrDateEmailTime(mythis, myevent.dateTimeStart) + ')'
|
2019-10-10 16:53:33 +02:00
|
|
|
},
|
|
|
|
|
|
2019-12-27 12:43:42 +01:00
|
|
|
getlangforQuasar(mylang) {
|
|
|
|
|
if (mylang === 'enUs')
|
|
|
|
|
return 'en-us'
|
|
|
|
|
else
|
|
|
|
|
return mylang
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-10 16:53:33 +02:00
|
|
|
setLangAtt(mylang) {
|
|
|
|
|
console.log('setLangAtt =', mylang)
|
|
|
|
|
// console.log('PRIMA this.$q.lang.isoName', this.$q.lang.isoName)
|
|
|
|
|
|
|
|
|
|
// dynamic import, so loading on demand only
|
2019-12-27 12:43:42 +01:00
|
|
|
import(`quasar/lang/${this.getlangforQuasar(mylang)}`).then((lang) => {
|
2019-10-10 16:53:33 +02:00
|
|
|
console.log(' Import dinamically lang =', lang)
|
2019-12-27 12:43:42 +01:00
|
|
|
Quasar.lang.set(this.getlangforQuasar(lang.default))
|
2019-10-10 16:53:33 +02:00
|
|
|
import(`../../statics/i18n`).then(() => {
|
|
|
|
|
console.log(' *** MY LANG DOPO=', Quasar.lang.isoName)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
2020-03-31 20:34:49 +02:00
|
|
|
GlobalStore.actions.addDynamicPages()
|
|
|
|
|
|
2019-10-10 16:53:33 +02:00
|
|
|
// this.$q.lang.set(mylang)
|
|
|
|
|
|
2020-03-31 20:34:49 +02:00
|
|
|
},
|
|
|
|
|
|
2019-12-27 12:43:42 +01:00
|
|
|
getappname(mythis, short) {
|
2019-10-10 16:53:33 +02:00
|
|
|
if (mythis === undefined)
|
|
|
|
|
return ''
|
|
|
|
|
if (mythis.$t === undefined)
|
|
|
|
|
return ''
|
2019-12-27 12:43:42 +01:00
|
|
|
if (short) {
|
2020-04-10 13:03:19 +02:00
|
|
|
return mythis.$t('ws.siteshortname')
|
2019-10-10 16:53:33 +02:00
|
|
|
} else {
|
2020-04-10 13:03:19 +02:00
|
|
|
return mythis.$t('ws.sitename')
|
2019-10-10 16:53:33 +02:00
|
|
|
}
|
2019-10-11 21:40:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
loginOk(mythis, ispageLogin: boolean) {
|
|
|
|
|
// console.log('loginOk')
|
|
|
|
|
|
|
|
|
|
if (toolsext.getLocale() !== '') {
|
|
|
|
|
mythis.$i18n.locale = toolsext.getLocale()
|
|
|
|
|
} // Set Lang
|
|
|
|
|
else {
|
|
|
|
|
UserStore.mutations.setlang(mythis.$i18n.locale)
|
|
|
|
|
} // Set Lang
|
|
|
|
|
|
|
|
|
|
if (process.env.DEBUG) {
|
|
|
|
|
console.log('LANG ORA=', toolsext.getLocale())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
globalroutines(mythis, 'loadapp', '')
|
|
|
|
|
|
2019-10-12 23:34:58 +02:00
|
|
|
tools.SignIncheckErrors(mythis, tools.OK, ispageLogin)
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-10-11 21:40:47 +02:00
|
|
|
|
|
|
|
|
loginInCorso(mythis) {
|
|
|
|
|
// console.log('loginInCorso')
|
|
|
|
|
|
|
|
|
|
let msg = mythis.$t('login.incorso')
|
2020-01-20 01:50:21 +01:00
|
|
|
// if (process.env.DEBUG) {
|
|
|
|
|
// msg += ' ' + process.env.MONGODB_HOST
|
|
|
|
|
// }
|
2019-10-11 21:40:47 +02:00
|
|
|
mythis.$q.loading.show({ message: msg })
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-10-11 21:40:47 +02:00
|
|
|
|
2019-12-31 00:44:43 +01:00
|
|
|
getUrlSite() {
|
|
|
|
|
const url = window.location.href
|
|
|
|
|
const arr = url.split('/')
|
|
|
|
|
return arr[0] + '//' + arr[2]
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
SignIncheckErrors(mythis, riscode, ispageLogin ?: boolean) {
|
2019-10-12 23:34:58 +02:00
|
|
|
// console.log('SignIncheckErrors: ', riscode)
|
2019-10-11 21:40:47 +02:00
|
|
|
try {
|
|
|
|
|
if (riscode === tools.OK) {
|
|
|
|
|
tools.showNotif(mythis.$q, mythis.$t('login.completato'), { color: 'positive', icon: 'check' })
|
|
|
|
|
if (ispageLogin) {
|
|
|
|
|
mythis.$router.push('/')
|
|
|
|
|
}
|
|
|
|
|
} else if (riscode === serv_constants.RIS_CODE_LOGIN_ERR) {
|
|
|
|
|
|
|
|
|
|
// Wait N seconds to avoid calling many times...
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
resolve('anything')
|
|
|
|
|
}, 3000)
|
|
|
|
|
}).then(() => {
|
|
|
|
|
setTimeout(() => {
|
2020-01-13 23:53:27 +01:00
|
|
|
// console.log('HIDE...')
|
2019-10-11 21:40:47 +02:00
|
|
|
mythis.$q.loading.hide()
|
|
|
|
|
}, 500)
|
|
|
|
|
tools.showNotif(mythis.$q, mythis.$t('login.errato'), { color: 'negative', icon: 'notifications' })
|
|
|
|
|
mythis.iswaitingforRes = false
|
|
|
|
|
if (ispageLogin) {
|
2019-10-20 01:22:38 +02:00
|
|
|
GlobalStore.state.RightDrawerOpen = true
|
|
|
|
|
// mythis.$router.push('/signin')
|
2019-10-11 21:40:47 +02:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2020-06-08 13:31:44 +02:00
|
|
|
} else if (riscode === serv_constants.RIS_CODE_LOGIN_ERR_SUBACCOUNT) {
|
|
|
|
|
|
|
|
|
|
// Wait N seconds to avoid calling many times...
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
resolve('anything')
|
|
|
|
|
}, 1000)
|
|
|
|
|
}).then(() => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
// console.log('HIDE...')
|
|
|
|
|
mythis.$q.loading.hide()
|
|
|
|
|
}, 500)
|
|
|
|
|
tools.showNotif(mythis.$q, mythis.$t('login.subaccount'), { color: 'negative', icon: 'notifications' })
|
|
|
|
|
mythis.iswaitingforRes = false
|
|
|
|
|
if (ispageLogin) {
|
|
|
|
|
GlobalStore.state.RightDrawerOpen = true
|
|
|
|
|
// mythis.$router.push('/signin')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2019-10-11 21:40:47 +02:00
|
|
|
} else if (riscode === tools.ERR_SERVERFETCH) {
|
|
|
|
|
tools.showNotif(mythis.$q, mythis.$t('fetch.errore_server'), { color: 'negative', icon: 'notifications' })
|
|
|
|
|
} else if (riscode === tools.ERR_GENERICO) {
|
|
|
|
|
const msg = mythis.$t('fetch.errore_generico') + UserStore.mutations.getMsgError(riscode)
|
|
|
|
|
tools.showNotif(mythis.$q, msg, { color: 'negative', icon: 'notifications' })
|
|
|
|
|
} else {
|
|
|
|
|
tools.showNotif(mythis.$q, 'Errore num ' + riscode, { color: 'negative', icon: 'notifications' })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (riscode !== serv_constants.RIS_CODE_LOGIN_ERR) {
|
|
|
|
|
mythis.iswaitingforRes = false
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
mythis.$q.loading.hide()
|
|
|
|
|
}, 200)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
// ...
|
|
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-09-19 22:56:19 +02:00
|
|
|
|
2020-01-30 01:20:23 +01:00
|
|
|
SignUpcheckErrors(mythis, riscode: number, msg: string) {
|
2019-10-12 23:34:58 +02:00
|
|
|
console.log('SignUpcheckErrors', riscode)
|
2020-01-13 23:53:27 +01:00
|
|
|
let endload = true
|
|
|
|
|
|
2019-12-29 23:29:56 +01:00
|
|
|
if (riscode === serv_constants.RIS_CODE_EMAIL_ALREADY_EXIST) {
|
2019-10-12 23:34:58 +02:00
|
|
|
tools.showNotif(mythis.$q, mythis.$t('reg.err.duplicate_email'))
|
2020-01-30 01:20:23 +01:00
|
|
|
} else if (riscode === serv_constants.RIS_CODE_USER_ALREADY_EXIST) {
|
|
|
|
|
tools.showNegativeNotif(mythis.$q, mythis.$t('reg.err.user_already_exist'))
|
2020-01-13 23:53:27 +01:00
|
|
|
} else if (riscode === serv_constants.RIS_CODE_USER_EXTRALIST_NOTFOUND) {
|
|
|
|
|
|
2020-01-30 01:20:23 +01:00
|
|
|
tools.showNegativeNotif(mythis.$q, mythis.$t('reg.err.user_extralist_not_found') + ' ' + msg)
|
2020-01-20 01:50:21 +01:00
|
|
|
} else if (riscode === serv_constants.RIS_CODE_USER_NOT_THIS_APORTADOR) {
|
|
|
|
|
|
2020-01-30 01:20:23 +01:00
|
|
|
tools.showNegativeNotif(mythis.$q, mythis.$t('reg.err.user_not_this_aportador') + ' ' + msg)
|
2020-01-13 23:53:27 +01:00
|
|
|
|
2020-07-13 23:36:15 +02:00
|
|
|
} else if (riscode === serv_constants.RIS_CODE_USERNAME_NOT_VALID) {
|
|
|
|
|
tools.showNotif(mythis.$q, mythis.$t('reg.err.username_not_valid'))
|
2019-12-29 23:29:56 +01:00
|
|
|
} else if (riscode === serv_constants.RIS_CODE_USERNAME_ALREADY_EXIST) {
|
2019-10-12 23:34:58 +02:00
|
|
|
tools.showNotif(mythis.$q, mythis.$t('reg.err.duplicate_username'))
|
|
|
|
|
} else if (riscode === tools.ERR_SERVERFETCH) {
|
|
|
|
|
tools.showNotif(mythis.$q, mythis.$t('fetch.errore_server'))
|
|
|
|
|
} else if (riscode === tools.ERR_GENERICO) {
|
|
|
|
|
const msg = mythis.$t('fetch.errore_generico') + UserStore.mutations.getMsgError(riscode)
|
|
|
|
|
tools.showNotif(mythis.$q, msg)
|
|
|
|
|
} else if (riscode === tools.OK) {
|
2020-01-27 15:09:11 +01:00
|
|
|
mythis.$router.push('/regok')
|
2020-05-10 21:06:42 +02:00
|
|
|
tools.showNotif(mythis.$q, mythis.$t('components.authentication.email_verification.link_sent', { botname: mythis.$t('ws.botname') }), {
|
2020-01-20 01:50:21 +01:00
|
|
|
color: 'green',
|
2019-10-12 23:34:58 +02:00
|
|
|
textColor: 'black'
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
tools.showNotif(mythis.$q, 'Errore num ' + riscode)
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-13 23:53:27 +01:00
|
|
|
return endload
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-10-12 23:34:58 +02:00
|
|
|
isCssColor(color) {
|
|
|
|
|
return !!color && !!color.match(/^(#|(rgb|hsl)a?\()/)
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-10-12 23:34:58 +02:00
|
|
|
displayClasses(eventparam) {
|
|
|
|
|
return {
|
2019-10-23 23:47:12 +02:00
|
|
|
// [`bg-${eventparam.bgcolor}`]: !tools.isCssColor(eventparam.bgcolor),
|
2019-10-12 23:34:58 +02:00
|
|
|
'text-white': !tools.isCssColor(eventparam.bgcolor)
|
|
|
|
|
}
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-10-12 23:34:58 +02:00
|
|
|
displayStyles(eventparam) {
|
|
|
|
|
const s = { color: '' }
|
|
|
|
|
if (tools.isCssColor(eventparam.bgcolor)) {
|
2019-10-23 23:47:12 +02:00
|
|
|
// s['background-color'] = eventparam.bgcolor
|
2019-10-12 23:34:58 +02:00
|
|
|
s.color = colors.luminosity(eventparam.bgcolor) > 0.5 ? 'black' : 'white'
|
|
|
|
|
}
|
|
|
|
|
return s
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-10-12 23:34:58 +02:00
|
|
|
CancelBookingEvent(mythis, eventparam: IEvents, bookeventid: string, notify: boolean) {
|
|
|
|
|
console.log('CancelBookingEvent ', eventparam)
|
2019-10-23 23:47:12 +02:00
|
|
|
tools.askConfirm(mythis.$q, translate('cal.titlebooking'), translate('cal.cancelbooking') + ' ' + tools.gettextevent(mythis, eventparam) + '?', translate('dialog.yes'), translate('dialog.no'), mythis, '', lists.MenuAction.DELETE, 0, {
|
2019-10-16 15:27:49 +02:00
|
|
|
param1: bookeventid,
|
2019-11-05 23:53:18 +01:00
|
|
|
param2: notify,
|
|
|
|
|
param3: eventparam.title
|
2019-10-16 15:27:49 +02:00
|
|
|
})
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
CancelEvent(mythis, eventparam: IEvents) {
|
|
|
|
|
console.log('CancelEvent ', eventparam)
|
|
|
|
|
tools.askConfirm(mythis.$q, translate('cal.event'), translate('cal.cancelevent') + ' ' + tools.gettextevent(mythis, eventparam) + '?', translate('dialog.yes'), translate('dialog.no'), mythis, '', lists.MenuAction.DELETE_EVENT, 0, {
|
|
|
|
|
param1: eventparam,
|
|
|
|
|
param2: true
|
|
|
|
|
})
|
2020-09-04 00:08:36 +02:00
|
|
|
},
|
|
|
|
|
AskGiaPartecipatoZoom(mythis, user) {
|
|
|
|
|
console.log('AskGiaPartecipatoZoom', user.username)
|
|
|
|
|
tools.askConfirm(mythis.$q, translate('steps.zoom_gia_partecipato'), translate('steps.zoom_gia_partecipato'), translate('dialog.yes'), translate('dialog.no'), mythis, '', lists.MenuAction.ZOOM_GIA_PARTECIPATO, 0, {
|
|
|
|
|
param1: user,
|
|
|
|
|
param2: user,
|
|
|
|
|
param3: 'Confermato',
|
|
|
|
|
})
|
|
|
|
|
},
|
2019-10-21 20:38:22 +02:00
|
|
|
ActionRecTable(mythis, action, table, id, item, askaction) {
|
2020-01-20 01:50:21 +01:00
|
|
|
// console.log('ActionRecTable', id)
|
2019-10-21 20:38:22 +02:00
|
|
|
return tools.askConfirm(mythis.$q, 'Action', translate(askaction) + '?', translate('dialog.yes'), translate('dialog.no'), mythis, table, action, 0, {
|
2019-10-16 15:27:49 +02:00
|
|
|
param1: id,
|
|
|
|
|
param2: item
|
|
|
|
|
})
|
2019-10-24 23:30:18 +02:00
|
|
|
}
|
|
|
|
|
,
|
2019-10-23 23:47:12 +02:00
|
|
|
|
|
|
|
|
async createNewRecord(mythis, table, data) {
|
|
|
|
|
|
|
|
|
|
const mydata = {
|
|
|
|
|
table,
|
2020-02-02 04:07:24 +01:00
|
|
|
data
|
2019-10-23 23:47:12 +02:00
|
|
|
}
|
|
|
|
|
|
2019-10-24 23:30:18 +02:00
|
|
|
return await
|
|
|
|
|
GlobalStore.actions.saveTable(mydata)
|
|
|
|
|
.then((record) => {
|
|
|
|
|
if (record) {
|
|
|
|
|
tools.showPositiveNotif(mythis.$q, mythis.$t('db.recupdated'))
|
|
|
|
|
} else {
|
|
|
|
|
tools.showNegativeNotif(mythis.$q, mythis.$t('db.recfailed'))
|
|
|
|
|
}
|
|
|
|
|
return record
|
|
|
|
|
})
|
2019-10-26 02:21:14 +02:00
|
|
|
},
|
|
|
|
|
getheight(mythis) {
|
|
|
|
|
// return height()
|
|
|
|
|
return mythis.$q.screen.height
|
|
|
|
|
},
|
2019-12-27 12:43:42 +01:00
|
|
|
getwidth(mythis, withright = false, withleft = true) {
|
2019-10-27 00:37:00 +02:00
|
|
|
// return height()
|
2019-11-15 00:32:39 +01:00
|
|
|
let myw = mythis.$q.screen.width
|
2019-12-27 12:43:42 +01:00
|
|
|
if (withleft) {
|
|
|
|
|
if (GlobalStore.state.leftDrawerOpen)
|
|
|
|
|
myw -= 300
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (withright)
|
|
|
|
|
if (GlobalStore.state.RightDrawerOpen)
|
|
|
|
|
myw -= 300
|
2019-11-15 00:32:39 +01:00
|
|
|
return myw
|
|
|
|
|
|
2019-10-27 00:37:00 +02:00
|
|
|
},
|
|
|
|
|
|
2019-11-12 21:33:18 +01:00
|
|
|
getwidthscale(mythis, mywidth, maxwidth) {
|
|
|
|
|
if (this.isMobile()) {
|
2019-12-27 12:43:42 +01:00
|
|
|
// if (mywidth > this.getwidth(mythis) - 20)
|
|
|
|
|
mywidth = this.getwidth(mythis, false, false) - 32
|
2019-11-21 00:19:42 +01:00
|
|
|
|
2019-12-27 12:43:42 +01:00
|
|
|
// console.log('mywidth', mywidth)
|
2019-11-12 21:33:18 +01:00
|
|
|
return mywidth
|
|
|
|
|
} else {
|
2019-12-07 00:20:55 +01:00
|
|
|
// console.log('this.getwidth(mythis) = ', this.getwidth(mythis))
|
2019-12-27 12:43:42 +01:00
|
|
|
let myw = mywidth + ((this.getwidth(mythis, true) - mywidth) * 0.6)
|
2019-12-07 00:20:55 +01:00
|
|
|
// console.log('myw1 = ', myw)
|
2019-11-12 21:33:18 +01:00
|
|
|
if (myw > maxwidth)
|
|
|
|
|
myw = maxwidth
|
2019-12-27 12:43:42 +01:00
|
|
|
if (myw > this.getwidth(mythis) - 24)
|
|
|
|
|
myw = this.getwidth(mythis) - 24
|
2019-11-12 21:33:18 +01:00
|
|
|
|
2019-12-07 00:20:55 +01:00
|
|
|
// console.log('myw = ', myw)
|
2019-11-12 21:33:18 +01:00
|
|
|
return myw
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getheightbywidth(mythis, mywidth, myheight, maxwidth) {
|
2020-01-20 01:50:21 +01:00
|
|
|
// console.log('getheightbywidth')
|
2019-11-12 21:33:18 +01:00
|
|
|
const myw = this.getwidthscale(mythis, mywidth, maxwidth)
|
|
|
|
|
return myw * (myheight / mywidth)
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-27 00:37:00 +02:00
|
|
|
isIsoDate(str) {
|
|
|
|
|
if (!/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(str)) return false
|
|
|
|
|
const d = new Date(str)
|
|
|
|
|
return d.toISOString() === str
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-26 02:21:14 +02:00
|
|
|
getLastDateReadReset() {
|
|
|
|
|
return new Date(1999, 1, 1, 0, 0, 0)
|
|
|
|
|
},
|
2019-10-23 23:47:12 +02:00
|
|
|
|
2019-10-14 20:32:15 +02:00
|
|
|
isBitActive(bit, whattofind) {
|
2019-10-28 19:00:06 +01:00
|
|
|
if (whattofind > 0)
|
|
|
|
|
return ((bit & whattofind) === whattofind)
|
|
|
|
|
else
|
|
|
|
|
return false
|
2019-10-27 00:37:00 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
SetBit(myval, bit) {
|
2020-02-07 22:08:01 +01:00
|
|
|
myval |= bit
|
|
|
|
|
return myval
|
|
|
|
|
},
|
|
|
|
|
UnSetBit(myval, bit) {
|
|
|
|
|
myval &= ~bit
|
2019-10-27 00:37:00 +02:00
|
|
|
return myval
|
|
|
|
|
},
|
|
|
|
|
getUnique(arr, comp) {
|
|
|
|
|
|
|
|
|
|
const unique = arr
|
|
|
|
|
.map(e => e[comp])
|
|
|
|
|
|
|
|
|
|
// store the keys of the unique objects
|
|
|
|
|
.map((e, i, final) => final.indexOf(e) === i && i)
|
|
|
|
|
|
|
|
|
|
// eliminate the dead keys & store unique objects
|
|
|
|
|
.filter(e => arr[e]).map(e => arr[e])
|
|
|
|
|
|
|
|
|
|
return unique
|
2019-10-28 19:00:06 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getColorByIndexBest(index) {
|
|
|
|
|
if (index < this.listBestColor.length - 1)
|
|
|
|
|
return this.listBestColor[index]
|
|
|
|
|
else
|
|
|
|
|
return 'primary'
|
2019-11-01 15:52:58 +01:00
|
|
|
},
|
2019-12-04 02:04:54 +01:00
|
|
|
getCookie(mytok, def?) {
|
2019-11-01 15:52:58 +01:00
|
|
|
const ris = Cookies.get(mytok)
|
2019-12-29 23:29:56 +01:00
|
|
|
// console.log('getCookie', ris)
|
2019-11-01 19:58:52 +01:00
|
|
|
if (!!ris) {
|
|
|
|
|
return ris
|
|
|
|
|
} else {
|
2019-12-04 02:04:54 +01:00
|
|
|
return def
|
2019-11-01 19:58:52 +01:00
|
|
|
}
|
2019-11-01 15:52:58 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setCookie(mytok, value: string) {
|
|
|
|
|
return Cookies.set(mytok, value)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
removeCookie(mytok) {
|
|
|
|
|
return Cookies.remove(mytok)
|
2019-11-01 19:58:52 +01:00
|
|
|
},
|
|
|
|
|
notshowPwd(payload) {
|
2019-11-04 20:29:35 +01:00
|
|
|
const mypay = { ...payload }
|
|
|
|
|
try {
|
2019-11-01 19:58:52 +01:00
|
|
|
if (!!mypay.password) {
|
|
|
|
|
mypay.password = '**********'
|
|
|
|
|
}
|
2019-11-04 20:29:35 +01:00
|
|
|
} catch (e) {
|
2019-11-01 19:58:52 +01:00
|
|
|
console.log('error', e)
|
|
|
|
|
}
|
|
|
|
|
return mypay
|
2019-11-04 20:29:35 +01:00
|
|
|
},
|
|
|
|
|
scrollToTop() {
|
|
|
|
|
const element = document.getElementById('mypage')
|
|
|
|
|
this.scrollToElement(element)
|
|
|
|
|
},
|
|
|
|
|
scrollToElementId(myid) {
|
|
|
|
|
const element = document.getElementById(myid)
|
|
|
|
|
this.scrollToElement(element)
|
|
|
|
|
},
|
|
|
|
|
scrollToElement(el) {
|
|
|
|
|
const target = getScrollTarget(el)
|
|
|
|
|
const offset = el.offsetTop
|
|
|
|
|
const duration = 500
|
|
|
|
|
console.log('target', target, 'offset', offset, 'duration', duration)
|
|
|
|
|
setScrollPosition(target, offset, duration)
|
2019-11-05 23:53:18 +01:00
|
|
|
},
|
|
|
|
|
getCellForWhatsapp(numbercell) {
|
2019-11-15 00:32:39 +01:00
|
|
|
if (!numbercell)
|
|
|
|
|
return ''
|
2019-11-05 23:53:18 +01:00
|
|
|
let mynum = numbercell.replace(/\-/g, '')
|
2019-12-04 02:04:54 +01:00
|
|
|
const intcode = GlobalStore.getters.getValueSettingsByKey('INT_CODE', false)
|
2019-11-05 23:53:18 +01:00
|
|
|
if (numbercell.substring(0, 1) !== '+')
|
|
|
|
|
mynum = intcode + mynum
|
|
|
|
|
else
|
|
|
|
|
mynum = mynum.substring(1)
|
|
|
|
|
|
|
|
|
|
return mynum
|
|
|
|
|
},
|
2019-10-11 21:40:47 +02:00
|
|
|
|
2019-11-05 23:53:18 +01:00
|
|
|
getHttpForWhatsapp(numbercell) {
|
2019-11-15 00:32:39 +01:00
|
|
|
if (!numbercell)
|
|
|
|
|
return ''
|
2019-11-05 23:53:18 +01:00
|
|
|
const mynum = this.getCellForWhatsapp(numbercell)
|
|
|
|
|
if (mynum)
|
|
|
|
|
return 'https://wa.me/' + mynum
|
|
|
|
|
else
|
|
|
|
|
return ''
|
2019-11-06 22:28:45 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getHttpForTelegram(usertelegram) {
|
|
|
|
|
if (usertelegram)
|
|
|
|
|
return 'https://t.me/' + usertelegram
|
|
|
|
|
else
|
|
|
|
|
return ''
|
2019-11-08 21:35:47 +01:00
|
|
|
},
|
2019-12-29 01:54:00 +01:00
|
|
|
getsuffisso() {
|
|
|
|
|
if (tools.isTest())
|
|
|
|
|
return 'TEST: '
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
2019-11-08 21:35:47 +01:00
|
|
|
metafunc(mythis) {
|
|
|
|
|
return {
|
2020-04-10 13:03:19 +02:00
|
|
|
title: mythis.$t('ws.sitename'),
|
|
|
|
|
titleTemplate: (title) => `${tools.getsuffisso()} ${mythis.mymeta.title} - ${mythis.$t('ws.sitename')}`,
|
2019-11-08 21:35:47 +01:00
|
|
|
meta: {
|
|
|
|
|
keywords: {
|
|
|
|
|
name: 'keywords',
|
|
|
|
|
content: mythis.mymeta.keywords
|
|
|
|
|
},
|
|
|
|
|
description: {
|
|
|
|
|
name: 'description',
|
|
|
|
|
content: mythis.mymeta.description
|
|
|
|
|
},
|
|
|
|
|
equiv: { 'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8' }
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-11-15 00:32:39 +01:00
|
|
|
},
|
|
|
|
|
isObject(anything) {
|
2020-02-02 04:07:24 +01:00
|
|
|
// Object.create(null) instanceof Object → false
|
2019-11-15 00:32:39 +01:00
|
|
|
return Object(anything) === anything
|
2019-12-04 18:21:17 +01:00
|
|
|
},
|
|
|
|
|
isDebug() {
|
|
|
|
|
return process.env.DEV
|
2019-12-07 00:20:55 +01:00
|
|
|
},
|
|
|
|
|
|
2019-12-29 01:54:00 +01:00
|
|
|
isTest() {
|
|
|
|
|
return process.env.ISTEST === '1'
|
|
|
|
|
},
|
|
|
|
|
|
2019-12-27 12:43:42 +01:00
|
|
|
geturlupload() {
|
|
|
|
|
return process.env.MONGODB_HOST + '/upload'
|
|
|
|
|
},
|
|
|
|
|
getheaders() {
|
|
|
|
|
return [{ name: 'x-auth', value: UserStore.state.x_auth_token }]
|
|
|
|
|
},
|
|
|
|
|
|
2019-12-28 02:17:07 +01:00
|
|
|
getextfile(filename) {
|
|
|
|
|
return filename.split('.').pop().toLowerCase()
|
|
|
|
|
},
|
|
|
|
|
|
2019-12-27 12:43:42 +01:00
|
|
|
getelembylang(arr) {
|
|
|
|
|
const mylang = toolsext.getLocale()
|
|
|
|
|
for (const elem in arr) {
|
|
|
|
|
if (arr[elem][mylang])
|
|
|
|
|
return arr[elem][mylang]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
isChristmasHoliday() {
|
|
|
|
|
const now = new Date()
|
|
|
|
|
return ((now.getMonth() === 11 && now.getDate() > 20) || (now.getMonth() === 0 && now.getDate() < 8))
|
2019-12-31 00:44:43 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
CapitalizeAllWords(str) {
|
|
|
|
|
const splitStr = str.toLowerCase().split(' ')
|
|
|
|
|
for (var i = 0; i < splitStr.length; i++) {
|
|
|
|
|
// You do not need to check if i is larger than splitStr length, as your for does that for you
|
|
|
|
|
// Assign it back to the array
|
|
|
|
|
splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1)
|
|
|
|
|
}
|
|
|
|
|
// Directly return the joined string
|
|
|
|
|
return splitStr.join(' ')
|
2020-01-13 23:53:27 +01:00
|
|
|
},
|
|
|
|
|
|
2020-06-08 13:31:44 +02:00
|
|
|
getValDb(keystr, serv, def?, table?, subkey?, id?) {
|
2020-01-13 23:53:27 +01:00
|
|
|
if (table === 'users') {
|
|
|
|
|
if (keystr === 'profile') {
|
|
|
|
|
return UserStore.state.my.profile[subkey]
|
|
|
|
|
} else {
|
|
|
|
|
return UserStore.state.my[keystr]
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
const ris = GlobalStore.getters.getValueSettingsByKey(keystr, serv)
|
2020-03-10 21:42:30 +01:00
|
|
|
|
2020-01-13 23:53:27 +01:00
|
|
|
if (ris === '')
|
|
|
|
|
if (def !== undefined)
|
|
|
|
|
return def
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
else
|
|
|
|
|
return ris
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getkey(youtube, title, isnum) {
|
|
|
|
|
let mykey = 'MP4'
|
|
|
|
|
if (youtube)
|
|
|
|
|
mykey = 'YT'
|
|
|
|
|
|
|
|
|
|
if (isnum) {
|
|
|
|
|
mykey += '_NUM'
|
|
|
|
|
} else {
|
|
|
|
|
if (title)
|
|
|
|
|
mykey += '_TITLE_'
|
|
|
|
|
else
|
|
|
|
|
mykey += '_VIDEO_'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return mykey
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
heightgallvideo() {
|
|
|
|
|
const h = this.heightgallery(this.getValDb('YT_W', false) / this.getValDb('YT_H', false))
|
|
|
|
|
return h
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getvideourl(index, youtube) {
|
|
|
|
|
const myvideo = this.getValDb(this.getkey(youtube, false, false) + index, false)
|
|
|
|
|
if (myvideo)
|
|
|
|
|
if (youtube)
|
|
|
|
|
return myvideo
|
|
|
|
|
else
|
|
|
|
|
return this.getpath(myvideo)
|
|
|
|
|
else
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getvideonum(youtube) {
|
|
|
|
|
return this.getValDb(this.getkey(youtube, false, true), false)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getvideomp4yt(index) {
|
|
|
|
|
return [{ src: 'https://www.youtube.com/embed/' + this.getvideourl(index, true), type: 'video/mp4' }
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
getvideomp4src(index) {
|
|
|
|
|
return [{ src: this.getvideourl(index, false), type: 'video/mp4' }
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getvideoyt(index) {
|
|
|
|
|
return 'https://www.youtube.com/embed/' + this.getvideourl(index, true)
|
|
|
|
|
},
|
|
|
|
|
|
2020-01-30 01:20:23 +01:00
|
|
|
getvideobyidyoutube(key) {
|
|
|
|
|
return 'https://www.youtube.com/embed/' + key
|
|
|
|
|
},
|
|
|
|
|
|
2020-01-13 23:53:27 +01:00
|
|
|
getpath(myvideo) {
|
|
|
|
|
return 'statics/video/' + func_tools.getLocale() + '/' + myvideo
|
|
|
|
|
},
|
|
|
|
|
mygetarrValDb(keystr, serv) {
|
|
|
|
|
const myval = GlobalStore.getters.getValueSettingsByKey(keystr, serv)
|
|
|
|
|
// console.log('AA: myval', myval)
|
|
|
|
|
try {
|
|
|
|
|
if (myval) {
|
|
|
|
|
// console.log(' Entro')
|
|
|
|
|
const myrec = JSON.parse(myval)
|
|
|
|
|
// console.log('*************** getarrValDb')
|
|
|
|
|
// console.table(myrec)
|
|
|
|
|
return myrec
|
|
|
|
|
} else {
|
|
|
|
|
// console.log('NO MYVAL')
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log('Errore: ', e)
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getvideotitle(index, youtube) {
|
|
|
|
|
|
|
|
|
|
const mykey = this.getkey(youtube, true, false) + index
|
|
|
|
|
const ris = this.mygetarrValDb(mykey, false)
|
|
|
|
|
|
|
|
|
|
return this.getelembylang(ris)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getvideoposter(index) {
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
clone(obj) {
|
2020-02-02 04:07:24 +01:00
|
|
|
if (null === obj || 'object' !== typeof obj) return obj
|
2020-01-13 23:53:27 +01:00
|
|
|
const copy = obj.constructor()
|
|
|
|
|
for (const attr in obj) {
|
|
|
|
|
if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr]
|
|
|
|
|
}
|
|
|
|
|
return copy
|
|
|
|
|
},
|
|
|
|
|
|
2020-01-21 01:38:28 +01:00
|
|
|
geticon(langin) {
|
2020-01-30 01:20:23 +01:00
|
|
|
if (langin === '')
|
|
|
|
|
return ''
|
|
|
|
|
try {
|
2020-05-19 00:18:55 +02:00
|
|
|
const lang = langin.toUpperCase()
|
|
|
|
|
|
2020-07-04 10:54:05 +02:00
|
|
|
const arrlang = ['IT', 'ES', 'PT', 'BR', 'US', 'GB', 'UK', 'DE', 'FR', 'SI', 'MD', 'IE', 'KE', 'AU', 'ML', 'DO',
|
2020-05-19 00:18:55 +02:00
|
|
|
'NG', 'SK', 'CH', 'CM', 'CO', 'CG', 'PE', 'MS', 'SM', 'HR', 'RO', 'VE', 'CL', 'PL', 'EG', 'AR', 'MX', 'SN', 'PK', 'AT', 'NP',
|
2020-09-04 00:08:36 +02:00
|
|
|
'CU', 'MA', 'PH', 'BA', 'UA', 'BE', 'NL', 'CI', 'BF']
|
2020-05-19 00:18:55 +02:00
|
|
|
|
|
|
|
|
const flag = arrlang.find((mylang) => mylang === lang)
|
|
|
|
|
if (!!flag) {
|
|
|
|
|
return 'fa-flag-' + flag.toLowerCase()
|
|
|
|
|
}
|
2020-01-21 01:38:28 +01:00
|
|
|
|
2020-01-30 01:20:23 +01:00
|
|
|
return ''
|
2020-05-19 00:18:55 +02:00
|
|
|
|
2020-02-02 04:07:24 +01:00
|
|
|
} catch (e) {
|
2020-01-30 01:20:23 +01:00
|
|
|
return ''
|
|
|
|
|
}
|
2020-01-21 01:38:28 +01:00
|
|
|
},
|
|
|
|
|
|
2020-01-27 15:09:11 +01:00
|
|
|
removespaces(mystr) {
|
|
|
|
|
return mystr.replace(/\s+/g, '')
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-07 22:08:01 +01:00
|
|
|
copyStringToClipboard(mythis, mystr, show) {
|
2020-01-27 15:09:11 +01:00
|
|
|
copyToClipboard(mystr).then(() => {
|
2020-02-07 22:08:01 +01:00
|
|
|
let msg = mythis.$t('dialog.copyclipboard')
|
|
|
|
|
if (show)
|
|
|
|
|
msg += ' \'' + mystr + '\''
|
|
|
|
|
|
|
|
|
|
tools.showNotif(mythis.$q, msg)
|
2020-01-27 15:09:11 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-07 22:08:01 +01:00
|
|
|
getlinkhref(mylink, text) {
|
|
|
|
|
return '<a href="' + mylink + '" target="_blank">' + text + '</a>'
|
|
|
|
|
},
|
|
|
|
|
|
2020-01-30 01:20:23 +01:00
|
|
|
getNationsByNationality(nat, code) {
|
2020-01-27 15:09:11 +01:00
|
|
|
if (nat === 'IT') {
|
|
|
|
|
return 'Italy'
|
|
|
|
|
} else if (nat === 'SI') {
|
|
|
|
|
return 'Slovenia'
|
2020-03-10 21:42:30 +01:00
|
|
|
} else if (nat === 'SK') {
|
|
|
|
|
return 'Slovakia'
|
2020-03-31 20:34:49 +02:00
|
|
|
} else if (nat === 'NG') {
|
|
|
|
|
return 'Nigeria'
|
2020-04-07 14:33:56 +02:00
|
|
|
} else if (nat === 'MD') {
|
|
|
|
|
return 'Moldova'
|
2020-01-27 15:09:11 +01:00
|
|
|
} else if (nat === 'ES') {
|
|
|
|
|
return 'Spain'
|
|
|
|
|
} else if (nat === 'DE') {
|
|
|
|
|
return 'Germany'
|
2020-01-30 01:20:23 +01:00
|
|
|
} else if (nat === 'FR') {
|
|
|
|
|
return 'France'
|
2020-01-27 15:09:11 +01:00
|
|
|
} else if (nat === 'US') {
|
|
|
|
|
return 'United States'
|
|
|
|
|
} else if (nat === 'CA') {
|
|
|
|
|
return 'Canada'
|
|
|
|
|
} else if (nat === 'MA') {
|
|
|
|
|
return 'Morocco'
|
|
|
|
|
} else if (nat === 'LT') {
|
|
|
|
|
return 'Lithuania'
|
|
|
|
|
} else if (nat === 'HR') {
|
|
|
|
|
return 'Croatia'
|
|
|
|
|
} else if (nat === 'HU') {
|
|
|
|
|
return 'Hungary'
|
|
|
|
|
} else if (nat === 'CH') {
|
|
|
|
|
return 'Switzerland'
|
2020-01-30 01:20:23 +01:00
|
|
|
} else if (nat === 'CM') {
|
|
|
|
|
return 'Cameroon'
|
|
|
|
|
} else if (nat === 'CO') {
|
|
|
|
|
return 'Colombia'
|
2020-01-27 15:09:11 +01:00
|
|
|
} else if (nat === 'PE') {
|
|
|
|
|
return 'Peru'
|
|
|
|
|
} else if (nat === 'PL') {
|
|
|
|
|
return 'Poland'
|
2020-01-30 01:20:23 +01:00
|
|
|
} else if (nat === 'SM') {
|
|
|
|
|
return 'San Marino'
|
2020-01-27 15:09:11 +01:00
|
|
|
} else if (nat === 'PT') {
|
|
|
|
|
return 'Portugal'
|
2020-02-19 16:10:05 +01:00
|
|
|
} else if ((nat === 'UK') || (nat === 'GB')) {
|
2020-01-27 15:09:11 +01:00
|
|
|
return 'United Kingdom'
|
|
|
|
|
} else if (nat === 'UA') {
|
|
|
|
|
return 'Ukraine'
|
2020-02-02 04:07:24 +01:00
|
|
|
} else if (nat === 'RO') {
|
|
|
|
|
return 'Romania'
|
2020-03-31 20:34:49 +02:00
|
|
|
} else if (nat === 'VE') {
|
|
|
|
|
return 'Venezuela'
|
2020-02-02 04:07:24 +01:00
|
|
|
} else if (nat === 'CL') {
|
|
|
|
|
return 'Chile'
|
2020-02-12 20:41:57 +01:00
|
|
|
} else if (nat === 'PL') {
|
|
|
|
|
return 'Poland'
|
|
|
|
|
} else if (nat === 'EG') {
|
|
|
|
|
return 'Egypt'
|
2020-03-10 21:42:30 +01:00
|
|
|
} else if (nat === 'BR') {
|
|
|
|
|
return 'Brazil'
|
2020-05-19 00:18:55 +02:00
|
|
|
} else if (nat === 'CG') {
|
|
|
|
|
return 'Congo'
|
|
|
|
|
} else if (nat === 'AR') {
|
|
|
|
|
return 'Argentina'
|
|
|
|
|
} else if (nat === 'MX') {
|
|
|
|
|
return 'Mexico'
|
|
|
|
|
} else if (nat === 'SN') {
|
|
|
|
|
return 'Senegal'
|
|
|
|
|
} else if (nat === 'PK') {
|
|
|
|
|
return 'Pakistan'
|
|
|
|
|
} else if (nat === 'AT') {
|
|
|
|
|
return 'Austria'
|
|
|
|
|
} else if (nat === 'NP') {
|
|
|
|
|
return 'Nepal'
|
|
|
|
|
} else if (nat === 'CU') {
|
|
|
|
|
return 'Cuba'
|
|
|
|
|
} else if (nat === 'MA') {
|
|
|
|
|
return 'Morocco'
|
|
|
|
|
} else if (nat === 'PH') {
|
|
|
|
|
return 'Philippines'
|
|
|
|
|
} else if (nat === 'BA') {
|
|
|
|
|
return 'Bosnia and Herzegovina'
|
|
|
|
|
} else if (nat === 'BE') {
|
|
|
|
|
return 'Belgium'
|
|
|
|
|
} else if (nat === 'NL') {
|
|
|
|
|
return 'Netherlands'
|
|
|
|
|
} else if (nat === 'MS') {
|
|
|
|
|
return 'Montserrat'
|
|
|
|
|
} else if (nat === 'CI') {
|
|
|
|
|
return 'Cote d\'Ivoire'
|
2020-09-04 00:08:36 +02:00
|
|
|
} else if (nat === 'BF') {
|
|
|
|
|
return 'Burkina Faso'
|
2020-07-04 10:54:05 +02:00
|
|
|
} else if (nat === 'IE') {
|
|
|
|
|
return 'Ireland'
|
|
|
|
|
} else if (nat === 'KE') {
|
|
|
|
|
return 'Kenya'
|
|
|
|
|
} else if (nat === 'AU') {
|
|
|
|
|
return 'Australia'
|
|
|
|
|
} else if (nat === 'ML') {
|
|
|
|
|
return 'Mali'
|
|
|
|
|
} else if (nat === 'DO') {
|
|
|
|
|
return 'Dominican Republic'
|
2020-01-27 15:09:11 +01:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-02 04:07:24 +01:00
|
|
|
getLinkZoom() {
|
|
|
|
|
let id = ''
|
|
|
|
|
if (GlobalStore.state.calzoom.length > 0) {
|
|
|
|
|
id = GlobalStore.state.calzoom.slice(-1)[0].id_conf_zoom.toString()
|
|
|
|
|
} else {
|
|
|
|
|
id = '6668882000'
|
|
|
|
|
}
|
|
|
|
|
return 'https://zoom.us/j/' + id
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-07 22:08:01 +01:00
|
|
|
myprintf(val, params: any[]) {
|
2020-02-02 04:07:24 +01:00
|
|
|
|
2020-02-07 22:08:01 +01:00
|
|
|
params.forEach((par) => {
|
|
|
|
|
val = val.replace('{' + par.strin + '}', par.strout)
|
|
|
|
|
})
|
|
|
|
|
return val
|
2020-03-10 21:42:30 +01:00
|
|
|
},
|
|
|
|
|
|
2020-05-10 21:06:42 +02:00
|
|
|
translate(params, options?) {
|
|
|
|
|
const msg = params.split('.')
|
|
|
|
|
const lang = toolsext.getLocale()
|
|
|
|
|
|
|
|
|
|
const stringa = messages[lang]
|
|
|
|
|
|
|
|
|
|
let ris = stringa
|
|
|
|
|
if (!!ris) {
|
|
|
|
|
msg.forEach((param) => {
|
|
|
|
|
ris = ris[param]
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if (!!options) {
|
|
|
|
|
ris = this.myprintf(ris, options)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
console.log('ERRORE IN TRANSLATE! ', params, ' NON ESISTE!')
|
|
|
|
|
return params
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ris
|
|
|
|
|
},
|
|
|
|
|
|
2020-09-04 00:08:36 +02:00
|
|
|
isSel2Metodi(user) {
|
2020-03-10 21:42:30 +01:00
|
|
|
if (user.profile.paymenttypes) {
|
2020-09-04 00:08:36 +02:00
|
|
|
return user.profile.paymenttypes.length > 1
|
2020-03-10 21:42:30 +01:00
|
|
|
}
|
2020-09-04 00:08:36 +02:00
|
|
|
return false
|
2020-03-10 21:42:30 +01:00
|
|
|
|
|
|
|
|
},
|
2020-09-04 00:08:36 +02:00
|
|
|
|
2020-03-10 21:42:30 +01:00
|
|
|
getnumrequisiti(user) {
|
|
|
|
|
let req = 0
|
|
|
|
|
|
|
|
|
|
req += user.verified_email ? 1 : 0
|
|
|
|
|
req += user.profile.teleg_id > 0 ? 1 : 0
|
|
|
|
|
req += this.isBitActive(user.profile.saw_and_accepted, shared_consts.Accepted.CHECK_READ_GUIDELINES.value) ? 1 : 0
|
|
|
|
|
req += this.isBitActive(user.profile.saw_and_accepted, shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI.value) ? 1 : 0
|
|
|
|
|
req += user.profile.saw_zoom_presentation ? 1 : 0
|
|
|
|
|
if (!!user.profile.my_dream)
|
|
|
|
|
req += user.profile.my_dream.length >= 10 ? 1 : 0
|
2020-09-04 00:08:36 +02:00
|
|
|
req += this.isSel2Metodi(user) ? 1 : 0
|
2020-03-10 21:42:30 +01:00
|
|
|
|
|
|
|
|
return req
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
Is7ReqOk(user) {
|
|
|
|
|
return this.getnumrequisiti(user) === 7
|
|
|
|
|
},
|
|
|
|
|
|
2020-05-10 21:06:42 +02:00
|
|
|
getRiganave(riga) {
|
|
|
|
|
let ris = riga - 3
|
|
|
|
|
if (ris <= 1)
|
|
|
|
|
ris = 1
|
|
|
|
|
|
|
|
|
|
return ris
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getColnave(col) {
|
|
|
|
|
let ris = Math.ceil(col / (2 * 4))
|
|
|
|
|
if (ris <= 1)
|
|
|
|
|
ris = 1
|
|
|
|
|
return ris
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getrigacolstr(mianave) {
|
|
|
|
|
return this.getRiganave(mianave.riga) + '.' + this.getColnave(mianave.col)
|
|
|
|
|
},
|
|
|
|
|
|
2020-05-11 22:43:54 +02:00
|
|
|
getlastnavestr(lastnave) {
|
|
|
|
|
return lastnave.riga + '.' + lastnave.col
|
|
|
|
|
},
|
|
|
|
|
|
2020-05-10 21:06:42 +02:00
|
|
|
getmaxcol(riga) {
|
|
|
|
|
|
|
|
|
|
return Math.pow(2, riga - 1)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getrigaNaveByPosiz(riga) {
|
|
|
|
|
let ris = riga + 3
|
|
|
|
|
if (ris <= 1)
|
|
|
|
|
ris = 1
|
|
|
|
|
return ris
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getcolNaveByPosiz(col) {
|
2020-05-11 22:43:54 +02:00
|
|
|
let ris = Math.ceil(col * Math.pow(2, 3))
|
2020-05-10 21:06:42 +02:00
|
|
|
if (ris <= 1)
|
|
|
|
|
ris = 1
|
|
|
|
|
return ris
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getfirstnaveSognatore(riga, col) {
|
|
|
|
|
const myriga = this.getrigaNaveByPosiz(riga)
|
|
|
|
|
const mycol = this.getcolNaveByPosiz(col)
|
|
|
|
|
|
2020-05-11 22:43:54 +02:00
|
|
|
// console.log(`${riga}.${col} => ${myriga}.${mycol}`)
|
2020-05-10 21:06:42 +02:00
|
|
|
return { riga: myriga, col: mycol }
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getnumnavi_finoa(naveorig, navedest, lastnave) {
|
|
|
|
|
let contaattuale = 0
|
|
|
|
|
let contatot = 0
|
|
|
|
|
|
|
|
|
|
const indrigaattuale = lastnave.riga
|
|
|
|
|
const indcolattuale = lastnave.col
|
|
|
|
|
|
|
|
|
|
if (navedest.riga < indrigaattuale) {
|
|
|
|
|
return { perc: 100, totale: 0, contaattuale: 0 }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (let indriga = naveorig.riga; indriga <= navedest.riga; indriga++) {
|
|
|
|
|
|
|
|
|
|
let startcol = 0
|
|
|
|
|
if (indriga === naveorig.riga) {
|
|
|
|
|
startcol = naveorig.col
|
|
|
|
|
}
|
|
|
|
|
let endcol = this.getmaxcol(indriga)
|
|
|
|
|
if (indriga === navedest.riga) {
|
|
|
|
|
endcol = navedest.col
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (indriga <= navedest.riga) {
|
|
|
|
|
contatot += (endcol - startcol)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (indriga < indrigaattuale) {
|
|
|
|
|
contaattuale += (endcol - startcol)
|
|
|
|
|
} else if (indriga === indrigaattuale) {
|
|
|
|
|
contaattuale += indcolattuale
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let perc = 0
|
|
|
|
|
if (contatot > 0)
|
|
|
|
|
perc = (contaattuale / contatot) * 100
|
|
|
|
|
|
|
|
|
|
if (perc > 100)
|
|
|
|
|
perc = 100
|
|
|
|
|
|
2020-05-11 22:43:54 +02:00
|
|
|
// console.log('naveorig', naveorig.riga, '.', naveorig.col, 'dest', navedest.riga, ',', navedest.col)
|
|
|
|
|
// console.log('lastnave', lastnave.riga, '.', lastnave.col)
|
|
|
|
|
// console.log('contaattuale', contaattuale, 'contatot', contatot, 'perc', perc)
|
2020-05-10 21:06:42 +02:00
|
|
|
|
|
|
|
|
return { perc, totale: contatot, contaattuale }
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
sito_online(pertutti) {
|
|
|
|
|
|
|
|
|
|
let ris = true
|
|
|
|
|
const online = this.getValDb('SITO_ONLINE', false, true)
|
|
|
|
|
ris = UserStore.state.isAdmin && !pertutti ? true : online
|
|
|
|
|
// console.log('isadmin', UserStore.state.isAdmin)
|
|
|
|
|
return ris
|
2020-05-11 22:43:54 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getsize() {
|
|
|
|
|
if (this.isMobile()) {
|
|
|
|
|
return '0.85rem'
|
|
|
|
|
} else {
|
|
|
|
|
return '1rem'
|
|
|
|
|
}
|
2020-06-08 13:31:44 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getsizesmall() {
|
|
|
|
|
if (this.isMobile()) {
|
|
|
|
|
return '0.75rem'
|
|
|
|
|
} else {
|
|
|
|
|
return '0.85rem'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
convertiTagHTMLPerBOT(msg) {
|
2020-05-10 21:06:42 +02:00
|
|
|
|
2020-06-08 13:31:44 +02:00
|
|
|
msg = msg.replace(/<strong>/g, '<b>')
|
|
|
|
|
msg = msg.replace(/<\/strong>/g, '</b>')
|
|
|
|
|
|
|
|
|
|
return msg
|
2020-07-04 10:54:05 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getlinkstd(link) {
|
|
|
|
|
let mylink = link
|
|
|
|
|
if (!!link) {
|
|
|
|
|
if (!link.startsWith('http')) {
|
|
|
|
|
mylink = 'https://' + link
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return mylink
|
2020-09-04 00:08:36 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
isselectPaypal() {
|
|
|
|
|
if (UserStore.state.my.profile) {
|
|
|
|
|
if (UserStore.state.my.profile.paymenttypes) {
|
|
|
|
|
if (UserStore.state.my.profile.paymenttypes.includes('paypal')) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
isselectPayeer() {
|
|
|
|
|
if (UserStore.state.my.profile) {
|
|
|
|
|
if (UserStore.state.my.profile.paymenttypes) {
|
|
|
|
|
if (UserStore.state.my.profile.paymenttypes.includes('payeer')) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
isselectRevolut() {
|
|
|
|
|
if (UserStore.state.my.profile) {
|
|
|
|
|
if (UserStore.state.my.profile.paymenttypes) {
|
|
|
|
|
if (UserStore.state.my.profile.paymenttypes.includes('revolut')) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
isselectAdvCash() {
|
|
|
|
|
if (UserStore.state.my.profile) {
|
|
|
|
|
if (UserStore.state.my.profile.paymenttypes) {
|
|
|
|
|
if (UserStore.state.my.profile.paymenttypes.includes('advcash')) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
}
|
2020-06-08 13:31:44 +02:00
|
|
|
}
|
2019-11-04 20:29:35 +01:00
|
|
|
|
2019-07-10 11:37:00 +02:00
|
|
|
// getLocale() {
|
|
|
|
|
// if (navigator.languages && navigator.languages.length > 0) {
|
|
|
|
|
// return navigator.languages[0]
|
|
|
|
|
// } else {
|
|
|
|
|
// return navigator.userLanguages || navigator.language || navigator.browserLanguages || 'it-IT'
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2018-11-17 20:32:28 +01:00
|
|
|
}
|