- Nuovo Sistema di Flotte per Tutor.

X - Mettere anche la email del sognatore, per chi è abituato ad inviarla in quel modo...
X - Controllare che sul sito compaiano le informazioni del Sognatore...
This commit is contained in:
Paolo Arena
2020-06-08 13:31:44 +02:00
parent bd6ccad236
commit 2fc89ebc82
29 changed files with 1669 additions and 280 deletions

View File

@@ -864,6 +864,32 @@ namespace Actions {
})
}
async function InviaMsgAFlotta(context, { flotta, inviareale, inviaemail, tipomsg }) {
console.log('InviaMsgAFlotta')
const mydata = {
idapp: process.env.APP_ID,
tipomsg,
flotta,
inviareale,
inviaemail,
}
return await Api.SendReq('/dashboard/msgflotta', '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 GetArrNavi(context) {
console.log('GetArrNavi')
@@ -886,6 +912,28 @@ namespace Actions {
})
}
async function GetMsgTemplates(context) {
console.log('GetMsgTemplates')
const mydata = {
idapp: process.env.APP_ID
}
return await Api.SendReq('/dashboard/getmsg_templates', '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 GetNave(context, { riga, col, riga1don, col1don, ind_order }) {
// console.log('GetNave')
@@ -960,6 +1008,55 @@ namespace Actions {
})
}
async function GetFlotte(context, { ricalcola, showall }) {
console.log('GetFlotte')
const mydata = {
idapp: process.env.APP_ID,
ricalcola,
showall
}
return await Api.SendReq('/dashboard/getflotte', 'POST', mydata)
.then((res) => {
if (res.status === 200) {
if (res.data.code === serv_constants.RIS_CODE_OK) {
return res.data.arrflotte
}
}
return null
})
.catch((error) => {
console.error(error)
return null
})
}
async function GetFlotta(context, { riga, col_prima, col_ultima}) {
console.log('GetFlotta')
const mydata = {
idapp: process.env.APP_ID,
riga,
col_prima,
col_ultima,
}
return await Api.SendReq('/dashboard/getflotta', 'POST', mydata)
.then((res) => {
if (res.status === 200) {
if (res.data.code === serv_constants.RIS_CODE_OK) {
return res.data
}
}
return null
})
.catch((error) => {
console.error(error)
return null
})
}
async function loadSite(context) {
// console.log('CalendarStore: loadAfterLogin')
// Load local data
@@ -1144,9 +1241,13 @@ namespace Actions {
sendEmailTest: b.dispatch(sendEmailTest),
DuplicateRec: b.dispatch(DuplicateRec),
InviaMsgADonatori: b.dispatch(InviaMsgADonatori),
InviaMsgAFlotta: b.dispatch(InviaMsgAFlotta),
GetArrNavi: b.dispatch(GetArrNavi),
GetMsgTemplates: b.dispatch(GetMsgTemplates),
GetNave: b.dispatch(GetNave),
GetArrDoniNavi: b.dispatch(GetArrDoniNavi),
GetFlotta: b.dispatch(GetFlotta),
GetFlotte: b.dispatch(GetFlotte),
GetData: b.dispatch(GetData),
addDynamicPages: b.dispatch(addDynamicPages)
}

View File

@@ -42,6 +42,8 @@ export const DefaultUser: IUserFields = {
teleg_id: 0,
saw_zoom_presentation: false,
saw_and_accepted: false,
qualified: false,
qualified_2invitati: false,
},
downline: [],
calcstat: DefaultCalc,
@@ -58,6 +60,8 @@ export const DefaultProfile: IUserProfile = {
sex: 0,
country_pay: '',
email_paypal: '',
link_payment: '',
note_payment: '',
username_telegram: '',
teleg_id: 0,
teleg_checkcode: 0,
@@ -65,7 +69,9 @@ export const DefaultProfile: IUserProfile = {
manage_telegram: false,
saw_zoom_presentation: false,
saw_and_accepted: false,
paymenttypes: []
paymenttypes: [],
qualified: false,
qualified_2invitati: false,
}
// State

View File

@@ -75,8 +75,26 @@ export const colgallery = [
}),
]
export const colmsg_templates = [
AddCol({ name: 'title', label_trans: 'pages.title' }),
AddCol({ name: 'typemsg', label_trans: 'TypeMsg', fieldtype: tools.FieldType.number }),
AddCol({ name: 'title_it', label_trans: 'Tit Ita', fieldtype: tools.FieldType.string }),
AddCol({ name: 'msg_it', label_trans: 'ITA', fieldtype: tools.FieldType.html }),
AddCol({ name: 'title_si', label_trans: 'Tit SLO', fieldtype: tools.FieldType.string }),
AddCol({ name: 'msg_si', label_trans: 'SLO', fieldtype: tools.FieldType.html }),
AddCol({ name: 'title_enUs', label_trans: 'Tit ENG', fieldtype: tools.FieldType.string }),
AddCol({ name: 'msg_enUs', label_trans: 'ENG', fieldtype: tools.FieldType.html }),
AddCol({ name: 'title_es', label_trans: 'Tit ESP', fieldtype: tools.FieldType.string }),
AddCol({ name: 'msg_es', label_trans: 'ESP', fieldtype: tools.FieldType.html }),
AddCol({ name: 'title_pt', label_trans: 'Tit POR', fieldtype: tools.FieldType.string }),
AddCol({ name: 'msg_pt', label_trans: 'POR', fieldtype: tools.FieldType.html }),
AddCol({ name: 'title_fr', label_trans: 'Tit FRA', fieldtype: tools.FieldType.string }),
AddCol({ name: 'msg_fr', label_trans: 'FRA', fieldtype: tools.FieldType.html }),
]
export const colmypage = [
AddCol({ name: 'title', label_trans: 'pages.title' }),
AddCol({ name: 'content', label_trans: 'pages.content', fieldtype: tools.FieldType.html }),
AddCol({ name: 'lang', label_trans: 'pages.lang' }),
AddCol({ name: 'path', label_trans: 'pages.path' }),
AddCol({ name: 'icon', label_trans: 'pages.icon' }),
@@ -86,7 +104,6 @@ export const colmypage = [
AddCol({ name: 'heightimg', label_trans: 'pages.heightimg', fieldtype: tools.FieldType.number }),
AddCol({ name: 'onlyif_logged', label_trans: 'pages.onlyif_logged', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'imgback', label_trans: 'pages.imgback', fieldtype: tools.FieldType.string }),
AddCol({ name: 'content', label_trans: 'pages.content', fieldtype: tools.FieldType.html }),
AddCol({ name: 'active', label_trans: 'pages.active', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'inmenu', label_trans: 'pages.inmenu', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'submenu', label_trans: 'pages.submenu', fieldtype: tools.FieldType.boolean }),
@@ -159,6 +176,12 @@ const colpaymenttype = [
AddCol(DeleteRec)
]
const colflotte = [
AddCol({ name: 'index', label_trans: 'others.value' }),
AddCol({ name: 'riga', label_trans: 'reg.riga' }),
AddCol({ name: 'col_prima', label_trans: 'ColPrima' }),
AddCol({ name: 'col_ultima', label_trans: 'ColUltima' }),
]
const colnavi = [
AddCol({ name: '_id', label_trans: 'others.value' }),
AddCol({ name: 'idListaIngresso', label_trans: 'idListaIngresso' }),
@@ -170,7 +193,11 @@ const colnavi = [
// AddCol({ name: 'date_gift_chat_open', label_trans: 'date_gift_chat_open', fieldtype: tools.FieldType.date }),
// AddCol({ name: 'link_chat', label_trans: 'reg.link_chat' }),
AddCol({ name: 'parent_id', label_trans: 'parent_id' }),
AddCol({ name: 'sent_msg_howto_make_gift', label_trans: 'sent_msg_howto_make_gift', fieldtype: tools.FieldType.boolean }),
AddCol({
name: 'sent_msg_howto_make_gift',
label_trans: 'sent_msg_howto_make_gift',
fieldtype: tools.FieldType.boolean
}),
// AddCol({ name: 'provvisoria', label_trans: 'reg.provvisoria', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'made_gift', label_trans: 'reg.made_gift', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'date_made_gift', label_trans: 'date_made_gift', fieldtype: tools.FieldType.date }),
@@ -192,7 +219,11 @@ const colnavepersistente = [
AddCol({ name: 'date_start', label_trans: 'dashboard.nave_in_chiusura', fieldtype: tools.FieldType.date }),
AddCol({ name: 'link_chat', label_trans: 'reg.link_chat' }),
AddCol({ name: 'provvisoria', label_trans: 'reg.provvisoria', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'note_bot', label_trans: 'note_bot', fieldtype: tools.FieldType.string }),
AddCol({ name: 'DoniAttesaDiConferma', label_trans: 'note_bot', fieldtype: tools.FieldType.number }),
AddCol({ name: 'DoniMancanti', label_trans: 'note_bot', fieldtype: tools.FieldType.number }),
AddCol({ name: 'DoniConfermati', label_trans: 'note_bot', fieldtype: tools.FieldType.number }),
AddCol({ name: 'DoniConfermati', label_trans: 'note_bot', fieldtype: tools.FieldType.number }),
AddCol({ name: 'DoniTotali', label_trans: 'note_bot', fieldtype: tools.FieldType.string }),
AddCol({ name: 'note_interne', label_trans: 'note_interne', fieldtype: tools.FieldType.string }),
AddCol({ name: 'tutor', label_trans: 'tutor', fieldtype: tools.FieldType.string }),
AddCol(DeleteRec),
@@ -206,6 +237,7 @@ const collistaingresso = [
AddCol({ name: 'invitante_username', label_trans: 'reg.aportador_solidario' }),
AddCol({ name: 'date_added', label_trans: 'date_added', fieldtype: tools.FieldType.date }),
AddCol({ name: 'added', label_trans: 'Aggiunto', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'navestr', label_trans: 'Nave', fieldtype: tools.FieldType.string }),
AddCol({ name: 'num_tess', label_trans: 'num_tess', fieldtype: tools.FieldType.number }),
AddCol({ name: 'note', label_trans: 'reg.note', fieldtype: tools.FieldType.string }),
AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: tools.FieldType.boolean }),
@@ -228,6 +260,8 @@ const colgraduatoria = [
AddCol({ name: 'numinvitatiTot', label_trans: 'Inv (Tot)', fieldtype: tools.FieldType.number }),
AddCol({ name: 'numinvitatiattiviTot', label_trans: 'Att. Tot', fieldtype: tools.FieldType.number }),
AddCol({ name: 'invitante_username', label_trans: 'reg.aportador_solidario' }),
AddCol({ name: 'navestr', label_trans: 'Nave', fieldtype: tools.FieldType.string }),
AddCol({ name: 'note', label_trans: 'note', fieldtype: tools.FieldType.string }),
AddCol({ name: 'date_added', label_trans: 'date_added', fieldtype: tools.FieldType.date }),
AddCol(DuplicateRec),
AddCol(DeleteRec)
@@ -469,10 +503,10 @@ export const fieldsTable = {
AddCol({ name: 'lang', label_trans: 'pages.lang' }),
AddCol({ name: 'typeconf', label_trans: 'zoom.typeconf' }),
AddCol({ name: 'date_start', label_trans: 'event.dateTimeStart', fieldtype: tools.FieldType.date }),
AddCol({ name: 'date_end', label_trans: 'event.dateTimeEnd' , fieldtype: tools.FieldType.date }),
AddCol({ name: 'benvenuto', label_trans: 'event.benvenuto' , fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'icon', label_trans: 'event.icon' , fieldtype: tools.FieldType.string }),
AddCol({ name: 'color', label_trans: 'event.color' , fieldtype: tools.FieldType.string }),
AddCol({ name: 'date_end', label_trans: 'event.dateTimeEnd', fieldtype: tools.FieldType.date }),
AddCol({ name: 'benvenuto', label_trans: 'event.benvenuto', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'icon', label_trans: 'event.icon', fieldtype: tools.FieldType.string }),
AddCol({ name: 'color', label_trans: 'event.color', fieldtype: tools.FieldType.string }),
AddCol({ name: 'id_conf_zoom', label_trans: 'zoom.id_conf_zooom' }),
AddCol({ name: 'note', label_trans: 'zoom.note' }),
AddCol(DeleteRec),
@@ -497,7 +531,7 @@ export const fieldsTable = {
AddCol(DuplicateRec),
],
// IColGridTable
// IColGridTable
colTableUsers: [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'index', label_trans: 'reg.index', fieldtype: tools.FieldType.number }),
@@ -505,33 +539,114 @@ export const fieldsTable = {
AddCol({ name: 'old_order', label_trans: 'old_order' }),
AddCol({ name: 'sospeso', label_trans: 'reg.sospeso', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'subaccount', label_trans: 'SubAccount', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'navinonpresenti', label_trans: 'Navi Non Presenti', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'non_voglio_imbarcarmi', label_trans: 'non_voglio_imbarcarmi', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'username', label_trans: 'reg.username_short' }),
AddCol({ name: 'name', label_trans: 'reg.name' }),
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
AddCol({ name: 'email', label_trans: 'reg.email' }),
AddCol({ name: 'verified_email', label_trans: 'reg.verified_email', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'profile.teleg_id', field: 'profile', subfield: 'teleg_id', label_trans: 'reg.teleg_id' }),
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.saw_zoom_presentation', field: 'profile', subfield: 'saw_zoom_presentation', label_trans: 'reg.saw_zoom_presentation', 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.saw_zoom_presentation',
field: 'profile',
subfield: 'saw_zoom_presentation',
label_trans: 'reg.saw_zoom_presentation',
fieldtype: tools.FieldType.boolean
}),
AddCol({
name: 'profile.qualified',
field: 'profile',
subfield: 'qualified',
label_trans: 'reg.qualified',
fieldtype: tools.FieldType.boolean
}),
AddCol({
name: 'profile.qualified_2invitati',
field: 'profile',
subfield: 'qualified_2invitati',
label_trans: '2_Inv',
fieldtype: tools.FieldType.boolean
}),
AddCol({ name: 'profile.my_dream', field: 'profile', subfield: 'my_dream', label_trans: 'reg.my_dream' }),
AddCol({ name: 'profile.email_paypal', field: 'profile', subfield: 'email_paypal', label_trans: 'reg.email_paypal' }),
AddCol({ name: 'profile.paymenttypes', field: 'profile', subfield: 'paymenttypes', label_trans: 'reg.paymenttype', fieldtype: tools.FieldType.multiselect, jointable: 'paymenttypes' }),
AddCol({
name: 'profile.email_paypal',
field: 'profile',
subfield: 'email_paypal',
label_trans: 'reg.email_paypal'
}),
AddCol({
name: 'profile.link_payment',
field: 'profile',
subfield: 'link_payment',
label_trans: 'reg.link_payment'
}),
AddCol({
name: 'profile.note_payment',
field: 'profile',
subfield: 'note_payment',
label_trans: 'reg.note_payment'
}),
AddCol({
name: 'profile.paymenttypes',
field: 'profile',
subfield: 'paymenttypes',
label_trans: 'reg.paymenttype',
fieldtype: tools.FieldType.multiselect,
jointable: 'paymenttypes'
}),
// AddCol({ name: 'made_gift', label_trans: 'reg.made_gift', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'note', label_trans: 'reg.note' }),
// AddCol({ name: 'aportador_solidario_ind_order', label_trans: 'reg.aportador_solidario_ind_order' }),
// AddCol({ name: 'aportador_solidario_nome_completo', label_trans: 'reg.aportador_solidario_nome_completo' }),
AddCol({ name: 'aportador_solidario', label_trans: 'reg.aportador_solidario' }),
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.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: 'lang', field: 'lang', label_trans: 'reg.lang' }),
AddCol({ name: 'profile.nationality', field: 'profile', subfield: 'nationality', label_trans: 'reg.nationality' }),
AddCol({ name: 'profile.intcode_cell', field: 'profile', subfield: 'intcode_cell', label_trans: 'reg.intcode_cell' }),
AddCol({
name: 'profile.intcode_cell',
field: 'profile',
subfield: 'intcode_cell',
label_trans: 'reg.intcode_cell'
}),
AddCol({ name: 'profile.iso2_cell', field: 'profile', subfield: 'iso2_cell', label_trans: 'reg.iso2_cell' }),
AddCol({ name: 'profile.cell', field: 'profile', subfield: 'cell', label_trans: 'reg.cell' }),
AddCol({ name: 'profile.country_pay', field: 'profile', subfield: 'country_pay', label_trans: 'reg.country_pay' }),
AddCol({ name: 'profile.teleg_id_old', field: 'profile', subfield: 'teleg_id_old', label_trans: 'reg.teleg_id_old' }),
AddCol({ name: 'profile.teleg_checkcode', field: 'profile', subfield: 'teleg_checkcode', label_trans: 'reg.teleg_checkcode' }),
AddCol({ name: 'profile.manage_telegram', field: 'profile', subfield: 'manage_telegram', label_trans: 'reg.manage_telegram', fieldtype: tools.FieldType.boolean }),
AddCol({
name: 'profile.teleg_id_old',
field: 'profile',
subfield: 'teleg_id_old',
label_trans: 'reg.teleg_id_old'
}),
AddCol({
name: 'profile.teleg_checkcode',
field: 'profile',
subfield: 'teleg_checkcode',
label_trans: 'reg.teleg_checkcode'
}),
AddCol({
name: 'profile.manage_telegram',
field: 'profile',
subfield: 'manage_telegram',
label_trans: 'reg.manage_telegram',
fieldtype: tools.FieldType.boolean
}),
AddCol({ name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false }),
AddCol({ name: 'date_reg', label_trans: 'reg.date_reg', fieldtype: tools.FieldType.date }),
AddCol({ name: 'lasttimeonline', label_trans: 'reg.lasttimeonline', fieldtype: tools.FieldType.date }),
@@ -555,23 +670,79 @@ export const fieldsTable = {
AddCol({ name: 'note', label_trans: 'reg.note' }),
AddCol({ name: 'aportador_solidario', label_trans: 'reg.aportador_solidario' }),
AddCol({ name: 'verified_email', label_trans: 'reg.verified_email', 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.saw_and_accepted', field: 'profile', subfield: 'saw_and_accepted', label_trans: 'reg.saw_and_accepted', fieldtype: tools.FieldType.binary, jointable: 'accepted' }),
AddCol({
name: 'profile.special_req',
field: 'profile',
subfield: 'special_req',
label_trans: 'reg.special_req',
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: 'lang', field: 'lang', label_trans: 'reg.lang' }),
AddCol({ name: 'profile.nationality', field: 'profile', subfield: 'nationality', label_trans: 'reg.nationality' }),
AddCol({ name: 'profile.intcode_cell', field: 'profile', subfield: 'intcode_cell', label_trans: 'reg.intcode_cell' }),
AddCol({
name: 'profile.intcode_cell',
field: 'profile',
subfield: 'intcode_cell',
label_trans: 'reg.intcode_cell'
}),
AddCol({ name: 'profile.iso2_cell', field: 'profile', subfield: 'iso2_cell', label_trans: 'reg.iso2_cell' }),
AddCol({ name: 'profile.cell', field: 'profile', subfield: 'cell', label_trans: 'reg.cell' }),
AddCol({ name: 'profile.email_paypal', field: 'profile', subfield: 'email_paypal', label_trans: 'reg.email_paypal' }),
AddCol({
name: 'profile.email_paypal',
field: 'profile',
subfield: 'email_paypal',
label_trans: 'reg.email_paypal'
}),
AddCol({ name: 'profile.teleg_id', field: 'profile', subfield: 'teleg_id', label_trans: 'reg.teleg_id' }),
AddCol({ name: 'profile.teleg_id_old', field: 'profile', subfield: 'teleg_id_old', label_trans: 'reg.teleg_id_old' }),
AddCol({ name: 'profile.teleg_checkcode', field: 'profile', subfield: 'teleg_checkcode', label_trans: 'reg.teleg_checkcode' }),
AddCol({ name: 'profile.manage_telegram', field: 'profile', subfield: 'manage_telegram', label_trans: 'reg.manage_telegram', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'profile.chisei', field: 'profile', subfield: 'chisei', label_trans: 'reg.chisei' }),
AddCol({ name: 'profile.iltuoimpegno', field: 'profile', subfield: 'iltuoimpegno', label_trans: 'reg.iltuoimpegno' }),
AddCol({ name: 'profile.come_aiutare', field: 'profile', subfield: 'come_aiutare', label_trans: 'reg.iltuoimpegno' }),
AddCol({ name: 'profile.paymenttypes', field: 'profile', subfield: 'paymenttypes', label_trans: 'reg.paymenttype', fieldtype: tools.FieldType.multiselect, jointable: 'paymenttypes' }),
AddCol({
name: 'profile.teleg_id_old',
field: 'profile',
subfield: 'teleg_id_old',
label_trans: 'reg.teleg_id_old'
}),
AddCol({
name: 'profile.teleg_checkcode',
field: 'profile',
subfield: 'teleg_checkcode',
label_trans: 'reg.teleg_checkcode'
}),
AddCol({
name: 'profile.manage_telegram',
field: 'profile',
subfield: 'manage_telegram',
label_trans: 'reg.manage_telegram',
fieldtype: tools.FieldType.boolean
}),
AddCol({ name: 'profile.chisei', field: 'profile', subfield: 'chisei', label_trans: 'reg.chisei' }),
AddCol({
name: 'profile.iltuoimpegno',
field: 'profile',
subfield: 'iltuoimpegno',
label_trans: 'reg.iltuoimpegno'
}),
AddCol({
name: 'profile.come_aiutare',
field: 'profile',
subfield: 'come_aiutare',
label_trans: 'reg.iltuoimpegno'
}),
AddCol({
name: 'profile.paymenttypes',
field: 'profile',
subfield: 'paymenttypes',
label_trans: 'reg.paymenttype',
fieldtype: tools.FieldType.multiselect,
jointable: 'paymenttypes'
}),
AddCol({ name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false }),
AddCol({ name: 'date_reg', label_trans: 'reg.date_reg', fieldtype: tools.FieldType.date }),
AddCol({ name: 'lasttimeonline', label_trans: 'reg.lasttimeonline', fieldtype: tools.FieldType.date }),
@@ -593,7 +764,11 @@ export const fieldsTable = {
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
AddCol({ name: 'note', label_trans: 'reg.note' }),
AddCol({ name: 'contacted', label_trans: 'reg.contacted', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'saw_zoom_presentation', label_trans: 'reg.saw_zoom_presentation', fieldtype: tools.FieldType.boolean }),
AddCol({
name: 'saw_zoom_presentation',
label_trans: 'reg.saw_zoom_presentation',
fieldtype: tools.FieldType.boolean
}),
AddCol({ name: 'num_invitati', label_trans: 'reg.num_invitati', fieldtype: tools.FieldType.number }),
AddCol({ name: 'is_in_whatsapp', label_trans: 'reg.is_in_whatsapp', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'is_in_telegram', label_trans: 'reg.is_in_telegram', fieldtype: tools.FieldType.boolean }),
@@ -601,7 +776,10 @@ export const fieldsTable = {
AddCol({ name: 'nationality', label_trans: 'reg.nationality', fieldtype: tools.FieldType.nationality }),
AddCol({ name: 'aportador_solidario_name_surname', label_trans: 'reg.aportador_solidario_nome_completo' }),
AddCol({ name: 'aportador_solidario_ind_order', label_trans: 'reg.aportador_solidario_ind_order' }),
AddCol({ name: 'aportador_solidario_originale_name_surname', label_trans: 'reg.aportador_solidario_nome_completo_orig' }),
AddCol({
name: 'aportador_solidario_originale_name_surname',
label_trans: 'reg.aportador_solidario_nome_completo_orig'
}),
AddCol({ name: 'col_b', label_trans: 'reg.col_b', fieldtype: tools.FieldType.number }),
AddCol({ name: 'col_h', label_trans: 'reg.col_h', fieldtype: tools.FieldType.number }),
AddCol(DeleteRec),
@@ -651,6 +829,13 @@ export const fieldsTable = {
colkey: '_id',
collabel: (rec) => rec.riga + '.' + rec.col
},
{
value: 'flotte',
label: 'Flotte',
columns: colflotte,
colkey: '_id',
collabel: (rec) => rec.riga + '.' + rec.col_prima + ' ' + rec.riga + '.' + rec.col_ultima
},
{
value: 'navepersistente',
label: 'Navi Persistenti',

View File

@@ -24,6 +24,7 @@ export const lists = {
REGALA_INVITANTE: 342,
SOSTITUISCI: 345,
INVIA_MSG_A_DONATORI: 350,
INVIA_MSG_A_FLOTTA: 352,
INVIA_MSG_A_SINGOLO: 355,
DONO_INVIATO: 360,
DONO_RICEVUTO: 370,

View File

@@ -17,6 +17,7 @@ export const serv_constants = {
RIS_CODE_LOGIN_ERR_GENERIC: -20,
RIS_CODE_LOGIN_ERR: -10,
RIS_CODE_LOGIN_ERR_SUBACCOUNT: -8,
RIS_CODE_OK: 1,
RIS_CODE_LOGIN_OK: 1,

View File

@@ -68,7 +68,14 @@ export const tools = {
TipoMsg: {
SEND_LINK_CHAT_DONATORI: 1,
SEND_MSG: 2,
SEND_MSG_SINGOLO: 3
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,
},
listBestColor: [
@@ -1542,6 +1549,7 @@ export const tools = {
username: par.param1.username,
invitante_username: '',
ind_order: -1,
num_tess: 0,
myfunc: func,
data: par.param2,
notifBot: null
@@ -1549,6 +1557,7 @@ export const tools = {
if (func === lists.MenuAction.CANCELLA_IMBARCO) {
mydatatosave.ind_order = par.param1.ind_order
mydatatosave.num_tess = par.param1.num_tess
mydatatosave.data.id = par.param2.rec._id
}
if (func === lists.MenuAction.AGGIUNGI_NUOVO_IMBARCO) {
@@ -1578,15 +1587,19 @@ export const tools = {
myfunc: func,
data: par.param2,
username: par.param2.username,
notifBot: null
notifBot: null,
inviaemail: par.param2.inviaemail,
}
if (par.param2.notifBot)
mydatatosave.notifBot = { un: par.param2, txt: par.param3 }
mydatatosave.notifBot = { un: par.param2.notifBot, txt: par.param3 }
myself.EseguiCallServer()
GlobalStore.actions.callFunz({ mydata: mydatatosave }).then((ris) => {
if (ris) {
myself.update_nave()
myself.Callback()
tools.showPositiveNotif(myself.$q, par.param3 + '\n' + ' e inviato messaggio per aprire la Gift Chat!')
} else
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
@@ -1623,6 +1636,24 @@ export const tools = {
} else
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
})
} 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'))
})
} else if (func === lists.MenuAction.INVIA_MSG_A_SINGOLO) {
// console.log('param1', par.param1)
GlobalStore.actions.InviaMsgADonatori({
@@ -1640,7 +1671,7 @@ export const tools = {
const mydatatosave = {
id: par.param1._id,
table: tools.TABNAVI,
fieldsvalue: { date_made_gift: par.param1.date_made_gift },
fieldsvalue: { date_made_gift: par.param1.date_made_gift, commento_al_sognatore: par.param1.commento_al_sognatore },
notifBot: null
}
@@ -1656,11 +1687,18 @@ export const tools = {
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
})
} else if (func === lists.MenuAction.DONO_RICEVUTO) {
const mydatatosave = {
let mydatatosave = {
id: par.param1._id,
table: tools.TABNAVI,
fieldsvalue: { made_gift: par.param1.made_gift, riga: par.param1.riga, col: par.param1.col },
notifBot: null
fieldsvalue: {},
notifBot: null,
tipomsg: tools.TipoMsg.SEND_MSG_DONO_RICEVUTO_CORRETTAMENTE
}
if (!!par.param1.date_made_gift) {
mydatatosave.fieldsvalue = { made_gift: par.param1.made_gift, riga: par.param1.riga, col: par.param1.col, date_made_gift: par.param1.date_made_gift }
} else {
mydatatosave.fieldsvalue = { made_gift: par.param1.made_gift, riga: par.param1.riga, col: par.param1.col }
}
if (par.param3) {
@@ -2234,6 +2272,15 @@ export const tools = {
return date.formatDate(mytimestamp, 'YYYY-MM-DD HH:mm:ss')
},
gettimestampstrDate(mydatestr) {
if (!!mydatestr) {
let mydate = new Date(mydatestr)
if (!!mydate)
return mydate.getTime()
}
return 0
},
// mystrdate "26.04.2013"
convertstrtoDate(mystrdate: string) {
if (mystrdate.length < 10) {
@@ -2556,9 +2603,13 @@ export const tools = {
} else if (Screen.width < 800) {
return '500'
} else if (Screen.width < 900) {
return '600'
} else {
return '700'
} else if (Screen.width < 1000) {
return '900'
} else if (Screen.width < 1100) {
return '1000'
} else {
return Screen.width - 200
}
},
@@ -2699,8 +2750,7 @@ export const tools = {
else {
return data.subtitle[static_data.arrLangUsed[0]]
}
}
,
},
gettitlecoll(data: IColl) {
if (data.title[toolsext.getLocale()])
return data.title[toolsext.getLocale()]
@@ -2923,6 +2973,26 @@ export const tools = {
}
})
} 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')
}
})
} 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) {
@@ -3276,7 +3346,7 @@ export const tools = {
return splitStr.join(' ')
},
getValDb(keystr, serv, def?, table?, subkey?) {
getValDb(keystr, serv, def?, table?, subkey?, id?) {
if (table === 'users') {
if (keystr === 'profile') {
return UserStore.state.my.profile[subkey]
@@ -3402,7 +3472,7 @@ export const tools = {
const arrlang = ['IT', 'ES', 'PT', 'BR', 'US', 'GB', 'UK', 'DE', 'FR', 'SI', 'MD',
'NG', 'SK', 'CH', 'CM', 'CO', 'CG', 'PE', 'MS', 'SM', 'HR', 'RO', 'VE', 'CL', 'PL', 'EG', 'AR', 'MX', 'SN', 'PK', 'AT', 'NP',
'CU', 'MA', 'PH', 'BA', 'UA', 'BE', 'NL', 'CI']
'CU', 'MA', 'PH', 'BA', 'UA', 'BE', 'NL', 'CI']
const flag = arrlang.find((mylang) => mylang === lang)
if (!!flag) {
@@ -3714,8 +3784,23 @@ export const tools = {
} else {
return '1rem'
}
}
},
getsizesmall() {
if (this.isMobile()) {
return '0.75rem'
} else {
return '0.85rem'
}
},
convertiTagHTMLPerBOT(msg) {
msg = msg.replace(/<strong>/g, '<b>')
msg = msg.replace(/<\/strong>/g, '</b>')
return msg
}
// getLocale() {
// if (navigator.languages && navigator.languages.length > 0) {