- Requirements
- Send Msg to Passeggeri
This commit is contained in:
Paolo Arena
2020-03-10 21:42:30 +01:00
parent 2f283d0710
commit 3f6ffc973a
66 changed files with 1670 additions and 547 deletions

View File

@@ -782,6 +782,33 @@ namespace Actions {
})
}
async function InviaMsgADonatori(context, { msgobj, navemediatore }) {
console.log('InviaMsgADonatori', msgobj)
const mydata = {
idapp: process.env.APP_ID,
tipomsg: tools.TipoMsg.SEND_LINK_CHAT_DONATORI,
msgextra: msgobj.msgextra,
msgpar1: msgobj.msgpar1,
inviareale: msgobj.inviareale,
navemediatore
}
return await Api.SendReq('/dashboard/msgnave', 'POST', mydata)
.then((res) => {
if (res.status === 200) {
if (res.data.code === serv_constants.RIS_CODE_OK) {
return res.data.ris
}
}
return null
})
.catch((error) => {
console.error(error)
return null
})
}
async function loadSite(context) {
// console.log('CalendarStore: loadAfterLogin')
// Load local data
@@ -930,6 +957,7 @@ namespace Actions {
DeleteFile: b.dispatch(DeleteFile),
sendEmailTest: b.dispatch(sendEmailTest),
DuplicateRec: b.dispatch(DuplicateRec),
InviaMsgADonatori: b.dispatch(InviaMsgADonatori),
addDynamicPages: b.dispatch(addDynamicPages)
}

View File

@@ -568,7 +568,7 @@ namespace Actions {
return await Api.SendReq('/users/dbop', 'POST', paramquery)
.then((res) => {
return res
return res.data
}).catch((error) => {
return false
})

View File

@@ -159,6 +159,37 @@ const colpaymenttype = [
AddCol(DeleteRec)
]
const colnavi = [
AddCol({ name: '_id', label_trans: 'others.value' }),
AddCol({ name: 'riga', label_trans: 'reg.riga' }),
AddCol({ name: 'col', label_trans: 'reg.col' }),
AddCol({ name: 'indprimario', label_trans: 'indprimario' }),
AddCol({ name: 'ind_order', label_trans: 'ind_order' }),
AddCol({ name: 'parent_id', label_trans: 'parent_id' }),
AddCol({ name: 'date_start', label_trans: 'date_start', fieldtype: tools.FieldType.date }),
AddCol({ name: 'link_chat', label_trans: 'reg.link_chat' }),
AddCol({ name: 'sent_msg_howto_make_gift', label_trans: 'sent_msg_howto_make_gift', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'made_gift', label_trans: 'made_gift', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'date_made_gift', label_trans: 'date_made_gift', fieldtype: tools.FieldType.date }),
AddCol({ name: 'received_gift', label_trans: 'received_gift', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'date_received_gift', label_trans: 'date_received_gift', fieldtype: tools.FieldType.date }),
AddCol({ name: 'num_tess', label_trans: 'num_tess', fieldtype: tools.FieldType.number }),
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
const collistaingresso = [
AddCol({ name: '_id', label_trans: 'others.value' }),
AddCol({ name: 'indprimario', label_trans: 'indprimario' }),
AddCol({ name: 'ind_order', label_trans: 'ind_order' }),
AddCol({ name: 'date_added', label_trans: 'date_added', fieldtype: tools.FieldType.date }),
AddCol({ name: 'added', label_trans: 'added', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'num_tess', label_trans: 'num_tess', fieldtype: tools.FieldType.number }),
AddCol({ name: 'deleted', label_trans: 'deleted', fieldtype: tools.FieldType.boolean }),
AddCol(DuplicateRec),
AddCol(DeleteRec)
]
const coldisciplines = [
AddCol({ name: 'typol_code', label_trans: 'disc.typol_code' }),
AddCol({ name: 'order', label_trans: 'disc.order', fieldtype: tools.FieldType.number }),
@@ -435,6 +466,7 @@ export const fieldsTable = {
AddCol({ name: 'verified_email', label_trans: 'reg.verified_email', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'profile.saw_zoom_presentation', field: 'profile', subfield: 'saw_zoom_presentation', label_trans: 'reg.saw_zoom_presentation', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'profile.special_req', field: 'profile', subfield: 'special_req', label_trans: 'reg.special_req', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'profile.vuole_ritessersi', field: 'profile', subfield: 'vuole_ritessersi', label_trans: 'reg.vuole_ritessersi', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'profile.saw_and_accepted', field: 'profile', subfield: 'saw_and_accepted', label_trans: 'reg.saw_and_accepted', fieldtype: tools.FieldType.binary, jointable: 'accepted' }),
AddCol({ name: 'profile.my_dream', field: 'profile', subfield: 'my_dream', label_trans: 'reg.my_dream' }),
AddCol({ name: 'profile.nationality', field: 'profile', subfield: 'nationality', label_trans: 'reg.nationality' }),
@@ -519,6 +551,20 @@ export const fieldsTable = {
colkey: 'key',
collabel: 'label'
},
{
value: 'navi',
label: 'Navi',
columns: colnavi,
colkey: '_id',
collabel: (rec) => rec.riga + '.' + rec.col
},
{
value: 'listaingressos',
label: 'Lista Ingresso',
columns: collistaingresso,
colkey: '_id',
collabel: 'indprimario',
},
{
value: 'disciplines',
label: 'Discipline',
@@ -526,7 +572,6 @@ export const fieldsTable = {
colkey: 'typol_code',
collabel: 'label'
},
{
value: 'newstosent',
label: 'Newsletter da Inviare',
@@ -577,10 +622,8 @@ export const fieldsTable = {
{
value: 'accepted',
label: 'Condizioni',
columns: colTablePermission,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
{

View File

@@ -21,6 +21,7 @@ export const lists = {
DELETE_EXTRALIST: 330,
DELETE_USERLIST: 335,
REGALA_INVITATO: 340,
INVIA_MSG_A_DONATORI: 350,
CAN_EDIT_TABLE: 400,
SHOW_PREV_REC: 401

View File

@@ -52,12 +52,16 @@ export interface INotify {
export const tools = {
CAN_EDIT: 'q-ce',
getprefCountries: ['it', 'si', 'us', 'es', 'pt', 'uk', 'fr', 'de', 'ch'],
getprefCountries: ['it', 'si', 'us', 'es', 'pt', 'uk', 'fr', 'de', 'ch', 'br', 'sk'],
APORTADOR_NONE: '------',
APORTADOR_SOLIDARIO: 'apsol',
TipoMsg: {
SEND_LINK_CHAT_DONATORI: 1,
},
listBestColor: [
'blue',
'green',
@@ -1416,7 +1420,7 @@ export const tools = {
executefunc(myself: any, table, func: number, par: IParamDialog) {
if (func === lists.MenuAction.DELETE) {
console.log('param1', par.param1)
// console.log('param1', par.param1)
CalendarStore.actions.CancelBookingEvent({
ideventbook: par.param1,
notify: par.param2 === true ? '1' : '0'
@@ -1429,7 +1433,7 @@ export const tools = {
tools.showNegativeNotif(myself.$q, myself.$t('cal.cancelederrorbooking'))
})
} else if (func === lists.MenuAction.DELETE_EVENT) {
console.log('param1', par.param1, 'id', par.param1._id)
// console.log('param1', par.param1, 'id', par.param1._id)
CalendarStore.actions.CancelEvent({ id: par.param1._id }).then((ris) => {
if (ris) {
// Remove this record from my list
@@ -1477,7 +1481,7 @@ export const tools = {
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
})
} else if (func === lists.MenuAction.DELETE_RECTABLE) {
console.log('param1', par.param1)
// console.log('param1', par.param1)
GlobalStore.actions.DeleteRec({ table, id: par.param1 }).then((ris) => {
if (ris) {
myself.ActionAfterYes(func, par.param2, null)
@@ -1486,7 +1490,7 @@ export const tools = {
tools.showNegativeNotif(myself.$q, myself.$t('db.recdelfailed'))
})
} else if (func === lists.MenuAction.DUPLICATE_RECTABLE) {
console.log('param1', par.param1)
// console.log('param1', par.param1)
GlobalStore.actions.DuplicateRec({ table, id: par.param1 }).then((ris) => {
if (ris) {
myself.ActionAfterYes(func, par.param2, ris.data)
@@ -1494,6 +1498,15 @@ export const tools = {
} else
tools.showNegativeNotif(myself.$q, myself.$t('db.recdupfailed'))
})
} else if (func === lists.MenuAction.INVIA_MSG_A_DONATORI) {
// console.log('param1', par.param1)
GlobalStore.actions.InviaMsgADonatori({ msgobj: par.param1, navemediatore: par.param2 }).then((ris) => {
if (ris) {
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, {})
} else
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
})
}
},
@@ -1505,7 +1518,6 @@ export const tools = {
notifBot: null
}
GlobalStore.actions.saveFieldValue(mydatatosave).then((ris) => {
if (ris) {
tools.showPositiveNotif(myself.$q, myself.$t('db.recupdated'))
@@ -1613,7 +1625,7 @@ export const tools = {
}
if (!(static_data.arrLangUsed.includes(mylang))) {
console.log('non incluso ', mylang)
// console.log('non incluso ', mylang)
mylang = static_data.arrLangUsed[0]
// Metti come default
@@ -1818,6 +1830,14 @@ export const tools = {
return ''
},
getstrshortDate(mytimestamp) {
// console.log('getstrDate', mytimestamp)
if (!!mytimestamp)
return date.formatDate(mytimestamp, 'DD/MM')
else
return ''
},
getstrTime(mytimestamp) {
// console.log('getstrDate', mytimestamp)
if (!!mytimestamp)
@@ -3051,6 +3071,7 @@ export const tools = {
}
} else {
const ris = GlobalStore.getters.getValueSettingsByKey(keystr, serv)
if (ris === '')
if (def !== undefined)
return def
@@ -3170,6 +3191,8 @@ export const tools = {
return 'fa-flag-es'
else if (lang === 'PT')
return 'fa-flag-pt'
else if (lang === 'BR')
return 'fa-flag-br'
else if (lang === 'US')
return 'fa-flag-us'
else if ((lang === 'GB') || (lang === 'UK'))
@@ -3180,6 +3203,8 @@ export const tools = {
return 'fa-flag-fr'
else if (lang === 'SI')
return 'fa-flag-si'
else if (lang === 'SK')
return 'fa-flag-sk'
else if (lang === 'CH')
return 'fa-flag-ch'
else if (lang === 'CM')
@@ -3231,6 +3256,8 @@ export const tools = {
return 'Italy'
} else if (nat === 'SI') {
return 'Slovenia'
} else if (nat === 'SK') {
return 'Slovakia'
} else if (nat === 'ES') {
return 'Spain'
} else if (nat === 'DE') {
@@ -3275,6 +3302,8 @@ export const tools = {
return 'Poland'
} else if (nat === 'EG') {
return 'Egypt'
} else if (nat === 'BR') {
return 'Brazil'
}
},
@@ -3294,7 +3323,38 @@ export const tools = {
val = val.replace('{' + par.strin + '}', par.strout)
})
return val
}
},
isPayPalSel(user) {
let ispaypal = false
if (user.profile.paymenttypes) {
if (user.profile.paymenttypes.includes('paypal')) {
if (user.email_paypal !== '')
ispaypal = true
}
}
return ispaypal
},
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
req += this.isPayPalSel(user) ? 1 : 0
return req
},
Is7ReqOk(user) {
return this.getnumrequisiti(user) === 7
},
// getLocale() {
// if (navigator.languages && navigator.languages.length > 0) {