- newsletter: prende la lista utenti (flag news_on)
- Abilita a Tutti la Newsletter news_on - isCommerciale - JobsInProgress - PCB: Corretto Totali che era a zero
This commit is contained in:
@@ -118,6 +118,7 @@ export const colmailinglist = [
|
||||
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
|
||||
AddCol({ name: 'email', label_trans: 'reg.email' }),
|
||||
AddCol({ name: 'news_on', label_trans: 'newsletter.news_on', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'diario_on', label_trans: 'newsletter.diario_on', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'email_errata', label_trans: 'newsletter.email_errata', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: costanti.FieldType.string }),
|
||||
AddCol(DeleteRec),
|
||||
@@ -151,29 +152,34 @@ export const colTableCatalogList = [
|
||||
label_trans: 'cataloglist.argomenti',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'catprtotali',
|
||||
isadvanced_field: true,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'condition_andor',
|
||||
label_trans: 'cataloglist.op_andor',
|
||||
fieldtype: costanti.FieldType.op_andor,
|
||||
isadvanced_field: true,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idCollane',
|
||||
label_trans: 'cataloglist.collane',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'collanastotali',
|
||||
isadvanced_field: true,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'editore',
|
||||
label_trans: 'cataloglist.editore',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'publishers_totali',
|
||||
isadvanced_field: true,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idTipoFormato',
|
||||
label_trans: 'cataloglist.idTipoFormato',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 't_web_tipiformatos',
|
||||
isadvanced_field: true,
|
||||
}),
|
||||
|
||||
AddCol({ name: 'descr_introduttiva', label_trans: 'cataloglist.descr_introduttiva', fieldtype: costanti.FieldType.html, maxlength: 1300 }),
|
||||
@@ -517,10 +523,24 @@ export const colopzemail = [
|
||||
AddCol(DuplicateRec),
|
||||
]
|
||||
|
||||
export const coldestnewsletter = [
|
||||
AddCol({ name: 'descr', label_trans: 'destnewsletter.descr' }),
|
||||
AddCol({
|
||||
name: 'tipodest_id',
|
||||
label_trans: 'destnewsletter.tipodest_id',
|
||||
fieldtype: costanti.FieldType.select,
|
||||
jointable: 'tipodest',
|
||||
}),
|
||||
]
|
||||
|
||||
|
||||
export const coltemplemail = [
|
||||
AddCol({ name: 'subject', label_trans: 'templemail.subject' }),
|
||||
AddCol({ name: 'testoheadermail', label_trans: 'templemail.testoheadermail', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'content', label_trans: 'templemail.content', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'disclaimer', label_trans: 'templemail.disclaimer', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'piedipagina', label_trans: 'templemail.piedipagina', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'firma', label_trans: 'templemail.firma', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'img', label_trans: 'templemail.img' }),
|
||||
AddCol({ name: 'content2', label_trans: 'templemail.content2', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'img2', label_trans: 'templemail.img2' }),
|
||||
@@ -537,6 +557,7 @@ export const coltemplemail = [
|
||||
export const colnewstosent = [
|
||||
AddCol({ name: 'label', label_trans: 'event.title' }),
|
||||
AddCol({ name: 'templemail_str', label_trans: 'newsletter.templemail' }),
|
||||
AddCol({ name: 'destnewsletter_str', label_trans: 'newsletter.destnewsletter' }),
|
||||
AddCol({ name: 'datetoSent', label_trans: 'newsletter.datetoSent', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'activate', label_trans: 'newsletter.activate', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'numemail_tot', label_trans: 'newsletter.numemail_tot', fieldtype: costanti.FieldType.number }),
|
||||
@@ -3244,6 +3265,8 @@ export const colTableUsers = [
|
||||
// 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: 'news_on', label_trans: 'reg.news_on', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'test', label_trans: 'reg.test', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'diario_on', label_trans: 'reg.diario_on', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'email_errata', label_trans: 'reg.email_errata', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'aportador_solidario', label_trans: 'reg.aportador_solidario' }),
|
||||
@@ -3533,6 +3556,8 @@ export const colTableUsersISP = [
|
||||
}),
|
||||
|
||||
AddCol({ name: 'news_on', label_trans: 'reg.news_on', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'diario_on', label_trans: 'reg.diario_on', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'test', label_trans: 'reg.test', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'email_errata', label_trans: 'reg.email_errata', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: costanti.FieldType.string }),
|
||||
|
||||
@@ -4628,6 +4653,14 @@ export const fieldsTable = {
|
||||
collabel: 'subject',
|
||||
onlyAdmin: true,
|
||||
},
|
||||
{
|
||||
value: 'destnewsletter',
|
||||
label: 'Dest Newsletter',
|
||||
columns: coldestnewsletter,
|
||||
colkey: '_id',
|
||||
collabel: 'descr',
|
||||
onlyAdmin: true,
|
||||
},
|
||||
{
|
||||
value: 'opzemail',
|
||||
label: 'Opzioni Email',
|
||||
@@ -5162,6 +5195,13 @@ export const fieldsTable = {
|
||||
colkey: 'value',
|
||||
collabel: 'label',
|
||||
},
|
||||
{
|
||||
value: 'tipodest',
|
||||
label: 'Template Cataloghi',
|
||||
columns: colTableGeneric,
|
||||
colkey: 'value',
|
||||
collabel: 'label',
|
||||
},
|
||||
],
|
||||
|
||||
}
|
||||
|
||||
@@ -2677,6 +2677,7 @@ export const tools = {
|
||||
|| (elem.onlyNotSoci && !userStore.my.profile.socio)
|
||||
|| (elem.onlyFacilitatore && userStore.isFacilitatore)
|
||||
|| (elem.onlyEditor && userStore.isEditor)
|
||||
|| (elem.onlyCommerciale && userStore.isCommerciale)
|
||||
|| (elem.onlyGrafico && userStore.isGrafico)
|
||||
|| (elem.onlyDepartment && userStore.isDepartment)
|
||||
|| ((!elem.onlyAdmin) && (!elem.onlyManager) && (!elem.onlyFacilitatore) && (!elem.onlyEditor) && (!elem.onlyDepartment)
|
||||
@@ -3206,6 +3207,11 @@ export const tools = {
|
||||
return userStore.isGrafico || userStore.isAdmin
|
||||
},
|
||||
|
||||
isCommerciale() {
|
||||
const userStore = useUserStore()
|
||||
return userStore.isCommerciale || userStore.isAdmin
|
||||
},
|
||||
|
||||
isTeacher() {
|
||||
const userStore = useUserStore()
|
||||
return userStore.isTeacher
|
||||
@@ -7617,7 +7623,7 @@ export const tools = {
|
||||
// return true
|
||||
|
||||
if (shared_consts.TABLES_PER_EDITORI.includes(tablesel)) {
|
||||
if (userStore.isEditor || userStore.isGrafico || userStore.isAdmin) {
|
||||
if (userStore.isCommerciale || userStore.isEditor || userStore.isGrafico || userStore.isAdmin) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -9823,7 +9829,7 @@ export const tools = {
|
||||
table: 'lista_editori',
|
||||
key: 'referenti',
|
||||
type: costanti.FieldType.select,
|
||||
value: this.getCookie(this.COOK_SEARCH + costanti.FILTER_SEP + shared_consts.TABLES_CATALOG + costanti.FILTER_SEP + 'referente', costanti.FILTER_TUTTI),
|
||||
value: this.getCookie(this.COOK_SEARCH + costanti.FILTER_SEP + shared_consts.TABLES_LISTA_EDITORI + costanti.FILTER_SEP + 'referente', costanti.FILTER_TUTTI),
|
||||
keycookie: '',
|
||||
addall: true,
|
||||
arrvalue: [],
|
||||
|
||||
@@ -91,6 +91,7 @@ export const toolsext = {
|
||||
TABMYBOT: 'bots',
|
||||
TABCALZOOM: 'calzoom',
|
||||
TABTEMPLEMAIL: 'templemail',
|
||||
TABDESTNEWSLETTER: 'destnewsletter',
|
||||
TABOPZEMAIL: 'opzemail',
|
||||
TABSHAREWITHUS: 'sharewithus',
|
||||
TABTYPEHOSP: 'typehosps',
|
||||
|
||||
@@ -312,14 +312,26 @@ export const useProducts = defineStore('Products', {
|
||||
return mystr;
|
||||
},
|
||||
|
||||
getTotaleOrdineByOrdId: (state: IProductsState) => (idOrdine: string, idGasordine: string, mostra_solo_ordini_produttore: boolean): number => {
|
||||
getTotaleOrdineByOrdId: (state: IProductsState) => (idOrdine: string, idGasordine: string, totale: boolean, mostra_solo_ordini_produttore: boolean, status: number): number => {
|
||||
|
||||
const arrprod = state.orders.filter((rec: IOrderCart) => {
|
||||
if (idGasordine && !rec.items?.some(item => item.order && item.order.idGasordine === idGasordine) || (rec._id !== idOrdine)) {
|
||||
return false; // Skip records not matching gasordine condition
|
||||
let arrprod = []
|
||||
|
||||
if (totale) {
|
||||
arrprod = state.orders.filter((rec: IOrderCart) => {
|
||||
if (idGasordine && !rec.items?.some(item => item.order && item.order.idGasordine === idGasordine) || (rec.status !== status)) {
|
||||
return false; // Skip records not matching gasordine condition
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
} else {
|
||||
arrprod = state.orders.filter((rec: IOrderCart) => {
|
||||
if (idGasordine && !rec.items?.some(item => item.order && item.order.idGasordine === idGasordine) || (rec._id !== idOrdine)) {
|
||||
return false; // Skip records not matching gasordine condition
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let subtotalPrice = 0
|
||||
|
||||
|
||||
@@ -1153,6 +1153,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
if (res.data) {
|
||||
globalStore.serv_settings = res.data.serv_settings
|
||||
globalStore.templemail = res.data.templemail
|
||||
globalStore.destnewsletter = res.data.destnewsletter
|
||||
globalStore.opzemail = res.data.opzemail
|
||||
}
|
||||
|
||||
@@ -1205,6 +1206,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
this.isDepartment = tools.isBitActive(this.my.perm, shared_consts.Permissions.Department.value)
|
||||
this.isTeacher = tools.isBitActive(this.my.perm, shared_consts.Permissions.Teacher.value)
|
||||
this.isEditor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Editor.value)
|
||||
this.isCommerciale = tools.isBitActive(this.my.perm, shared_consts.Permissions.Commerciale.value)
|
||||
this.isGrafico = tools.isBitActive(this.my.perm, shared_consts.Permissions.Grafico.value)
|
||||
|
||||
this.my.tokens = []
|
||||
|
||||
@@ -16,7 +16,8 @@ import type {
|
||||
IOptCatalogo,
|
||||
IProduct,
|
||||
IProductInfo,
|
||||
IVariazione
|
||||
IVariazione,
|
||||
IDestNewsletter
|
||||
} from '@model';
|
||||
import {
|
||||
ICity, IMySkill,
|
||||
@@ -420,6 +421,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === toolsext.TABNEWSLETTER) ris = state.newstosent
|
||||
else if (table === toolsext.TABGALLERY) ris = state.gallery
|
||||
else if (table === toolsext.TABTEMPLEMAIL) ris = state.templemail
|
||||
else if (table === toolsext.TABDESTNEWSLETTER) ris = state.destnewsletter
|
||||
else if (table === toolsext.TABOPZEMAIL) ris = state.opzemail
|
||||
else if (table === toolsext.TABMAILINGLIST) ris = state.mailinglist
|
||||
else if (table === toolsext.TABMYPAGE) ris = state.mypage
|
||||
@@ -532,6 +534,10 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
const myrec = mystate.templemail.find((rec) => rec._id === templid)
|
||||
return (!!myrec) ? myrec.subject! : ''
|
||||
},
|
||||
getdestnewsletterbyId: (mystate: IGlobalState) => (id: string): string => {
|
||||
const myrec = mystate.destnewsletter.find((rec: IDestNewsletter) => rec._id === id)
|
||||
return (!!myrec) ? myrec.descr! : ''
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
@@ -2213,6 +2219,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === toolsext.TABCALDATE) myarr = this.getArrDateEvent()
|
||||
else if (table === toolsext.TABCALALLDATE) myarr = this.getArrAllDateEvent()
|
||||
else if (table === toolsext.TABTYPEHOSP) myarr = shared_consts.TypeHosps
|
||||
else if (table === 'tipodest') myarr = shared_consts.DESTNEWSLETTER_ARRAY
|
||||
else if (table === 'versions') myarr = shared_consts.VERSIONI_PRODOTTO
|
||||
else if (table === toolsext.TABPEOPLE) myarr = shared_consts.People
|
||||
else if (table === toolsext.TABTYPEACCOM) myarr = shared_consts.TypeAccom
|
||||
|
||||
Reference in New Issue
Block a user