- Sistemato i Referenti (e non Editori), quando crei un nuovo Catalogo ti imposta la proprietà a te, ma chiunque Collaboratore potrebbe cmq modificartelo.

This commit is contained in:
Surya Paolo
2025-07-01 12:59:39 +02:00
parent 4b65400d50
commit 9e95fe622b
29 changed files with 138 additions and 84 deletions

View File

@@ -177,7 +177,7 @@
</div>
<div
v-if="
(tools.isManager() || tools.isEditor()) &&
(tools.isCollaboratore()) &&
!optcatalogo.generazionePDFInCorso &&
(editOn || options.show_edit_book)
"
@@ -195,7 +195,7 @@
color="primary"
icon="fas fa-pencil-alt"
v-if="
(tools.isManager() || tools.isEditor()) &&
(tools.isCollaboratore()) &&
!optcatalogo.generazionePDFInCorso &&
(editOn || options.show_edit_book)
"
@@ -203,7 +203,7 @@
<q-list>
<q-item
v-if="
(tools.isManager() || tools.isEditor()) &&
(tools.isCollaboratore()) &&
!optcatalogo.generazionePDFInCorso &&
(editOn || options.show_edit_book)
"
@@ -224,7 +224,7 @@
</q-item>
<q-item
v-if="
(tools.isManager() || tools.isEditor()) &&
(tools.isCollaboratore()) &&
!optcatalogo.generazionePDFInCorso &&
(editOn || options.show_edit_book)
"

View File

@@ -5,7 +5,7 @@
v-if="isfinishLoading"
>
<q-toggle
v-if="(tools.isManager() || tools.isEditor() || tools.isGrafico()) && !showMap && editOn"
v-if="(tools.isCollaboratore()) && !showMap && editOn"
v-model="editOn"
color="green"
icon="fas fa-pencil-alt"

View File

@@ -347,7 +347,7 @@
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CATALOGLIST">
<div v-if="editOn" class="elemEdit">Cataloghi</div>
<q-tabs v-if="tools.isEditor() || tools.isGrafico()" v-model="tabcatalogo" dense class="bg-green text-white">
<q-tabs v-if="tools.isCollaboratore()" v-model="tabcatalogo" dense class="bg-green text-white">
<q-tab name="griglia" icon="fas fa-eye" label="Griglia"> </q-tab>
<!--<q-tab name="statistiche" icon="fas fa-chart-pie" label="Statistiche"> </q-tab>-->
<q-tab name="lista" icon="fas fa-list" label="Lista"> </q-tab>
@@ -381,7 +381,7 @@
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.RACCOLTE_CATALOGHI">
<div v-if="editOn" class="elemEdit">Raccolte Cataloghi</div>
<q-tabs v-if="tools.isEditor() || tools.isGrafico()" v-model="tabcatalogo" dense class="bg-green text-white">
<q-tabs v-if="tools.isCollaboratore()" v-model="tabcatalogo" dense class="bg-green text-white">
<q-tab name="griglia" icon="fas fa-eye" label="Griglia"> </q-tab>
<q-tab name="lista" icon="fas fa-list" label="Lista"> </q-tab>
</q-tabs>

View File

@@ -146,7 +146,7 @@
>
aggiornato al ({{ tools.getstrDate(myrec.data_online_stampa) }})
</div>
<div
<!--<div
v-if="!tools.isUtente() && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"
>
@@ -159,6 +159,20 @@
da
{{ myrec.username_lista_generata }}
</span>
</div>-->
<div
v-if="!tools.isUtente() && dettagli && myrec.data_lista_updated"
class="text-caption text-h7 text-grey q-pb-xs"
>
<q-icon name="fas fa-list" /> Lista aggiornata il:
<span
:class="
`text-` + (tools.isDateValid(myrec.data_lista_updated) ? 'blue' : 'red')
"
>{{ tools.getstrDate(myrec.data_lista_updated) || '' }}
da
{{ myrec.username_lista_updated }}
</span>
</div>
</div>
<!--<div class="text-overline text-orange-9">{{collanestr}}</div>-->

View File

@@ -234,6 +234,12 @@ export default defineComponent({
field: 'pdf_online_size',
align: 'center',
},
{
name: 'data_online',
label: 'Data Online',
field: 'data_online',
align: 'center',
},
{
name: 'pdf_online_stampa',
label: 'PDF OnLine Stampa',
@@ -246,12 +252,6 @@ export default defineComponent({
field: 'pdf_online_stampa_size',
align: 'center',
},
{
name: 'data_online',
label: 'Data Online',
field: 'data_online',
align: 'center',
},
{
name: 'data_online_stampa',
label: 'Data Online Stampa',

View File

@@ -83,7 +83,7 @@
v-model="optcatalogo"
:idPage="idPage"
:options="{
show_edit_book: tools.isEditor(),
show_edit_book: tools.isCollaboratore(),
}"
@selauthor="selauthor"
:scheda="optcatalogo.arrSchede[0].scheda"

View File

@@ -50,7 +50,7 @@
</div>
<div v-if="
tools.isLogged() &&
(isAdmin() || tools.isEditor() || tools.isGrafico())
(isAdmin() || tools.isCollaboratore())
" class="text-h7">
<q-toggle :icon="'fas fa-pencil-alt'" v-model="editOn"> </q-toggle>
</div>

View File

@@ -38,6 +38,8 @@ export interface ICatalog {
pdf_generato_size?: string
data_generato?: Date
data_lista_generata?: Date
data_lista_updated?: Date
username_lista_updated?: string
username_lista_generata?: string
pdf_online?: string
pdf_online_size?: string

View File

@@ -299,4 +299,5 @@ export interface IUserState {
updateTables?: boolean
lista_editori?: IUserShort[] | null
lista_referenti?: IUserShort[] | null
}

View File

@@ -2057,7 +2057,7 @@ const msg_it = {
casaeditrice: 'Casa Editrice',
numprodotti: 'Libri presenti',
foto_collana: 'Foto Catalogo',
referenti: 'Editori',
referenti: 'Referenti',
img_bordata: 'Immagine di sfondo',
img_intro: 'Copertina introduttiva',
img_bordata_stampa: 'Immagine di sfondo (per STAMPA)',

View File

@@ -414,7 +414,7 @@ export const costanti = {
TABLES_ARRAY: ['circuits'],
TABLES_USERNAME_DATE: ['friends', 'friendsandme'],
TABLES_IMG_USERNAME: ['friends', 'friendsandme'],
TABLES_WITH_STR_TUTTI: ['lista_editori'],
TABLES_WITH_STR_TUTTI: ['lista_editori', 'lista_referenti'],
FILTER_SEP: '_',
FILTER_TUTTI_STR: '[Tutti]',

View File

@@ -188,7 +188,7 @@ export const colTableCatalogList = [
name: 'referenti',
label_trans: 'cataloglist.referenti',
fieldtype: costanti.FieldType.multiselect,
jointable: 'lista_editori',
jointable: 'lista_referenti',
}),
AddCol({
name: 'idPageAssigned',
@@ -5210,6 +5210,13 @@ export const fieldsTable = {
colkey: 'username',
collabel: 'name',
},
{
value: 'lista_referenti',
label: 'Referenti',
columns: colTableUsersGeneric,
colkey: 'username',
collabel: 'name',
},
{
value: 'mygroups',
label: 'Organizzazioni',

View File

@@ -10824,7 +10824,7 @@ export const tools = {
{
visible: !this.isUtente(),
label: 'Editore',
table: 'lista_editori',
table: 'lista_referenti',
key: 'referenti',
type: costanti.FieldType.select,
value: this.isUtente()
@@ -11123,14 +11123,18 @@ export const tools = {
},
getColorWithTransparency(color: string): string {
const hex = color.slice(1); // Rimuove il simbolo "#" dal colore
const r = parseInt(hex.substring(0, 2), 16);
const g = parseInt(hex.substring(2, 4), 16);
const b = parseInt(hex.substring(4, 6), 16);
const a = parseInt(hex.substring(6, 8), 16) / 255; // Trasformiamo la trasparenza in formato decimale
if (color) {
const hex = color.slice(1); // Rimuove il simbolo "#" dal colore
const r = parseInt(hex.substring(0, 2), 16);
const g = parseInt(hex.substring(2, 4), 16);
const b = parseInt(hex.substring(4, 6), 16);
const a = parseInt(hex.substring(6, 8), 16) / 255; // Trasformiamo la trasparenza in formato decimale
// Restituisce il colore con trasparenza in formato rgba
return `rgba(${r}, ${g}, ${b}, ${a})`;
// Restituisce il colore con trasparenza in formato rgba
return `rgba(${r}, ${g}, ${b}, ${a})`;
} else {
return ''
}
},
// FINE !

View File

@@ -217,6 +217,8 @@ export const useUserStore = defineStore('UserStore', {
isZoomeri: false,
isTratuttrici: false,
isEditor: false,
isCommerciale: false,
isCollaboratore: false,
isGrafico: false,
isTeacher: false,
usersList: [],
@@ -224,6 +226,7 @@ export const useUserStore = defineStore('UserStore', {
lastparamquery: {},
updateTables: false,
lista_editori: null,
lista_referenti: null,
}),
getters: {
@@ -234,6 +237,9 @@ export const useUserStore = defineStore('UserStore', {
listaEditori: (state: IUserState): any => {
return state.lista_editori;
},
listaReferenti: (state: IUserState): any => {
return state.lista_referenti;
},
getServerCode: (state: IUserState): number =>
state.servercode ? state.servercode : 0,
@@ -2519,5 +2525,12 @@ export const useUserStore = defineStore('UserStore', {
}
return this.lista_editori;
},
async loadListaReferenti() {
const globalStore = useGlobalStore();
if (!this.lista_referenti) {
this.lista_referenti = await globalStore.getObjOnServer('lista_referenti');
}
return this.lista_referenti;
},
},
});

View File

@@ -564,6 +564,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === 'friends') return userStore.my.profile.friends;
else if (table === 'lista_editori') {
ris = userStore.listaEditori;
} else if (table === 'lista_referenti') {
ris = userStore.listaReferenti;
} else if (table === 'friendsandme')
return [{ username: userStore.my.username }, ...userStore.my.profile.friends];
// else if (table === 'mygroups')
@@ -1251,6 +1253,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.clearDataAfterLoginOnlyIfActiveConnection();
await userStore.loadListaEditori();
await userStore.loadListaReferenti();
await globalroutines('readall', 'config', null);
@@ -2510,6 +2513,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
shared_consts.Permissions.Teacher,
shared_consts.Permissions.Facilitatore,
shared_consts.Permissions.Editor,
shared_consts.Permissions.Commerciale,
shared_consts.Permissions.Zoomeri,
shared_consts.Permissions.Department,
shared_consts.Permissions.Grafico,

View File

@@ -117,7 +117,7 @@ body {
height: calc(380 * var(--scalecatalogy) * 1px);
line-height: 130%;
font-weight: bold;
font-weight: normal;
padding: 8px;
border-radius: 20px;

View File

@@ -1123,6 +1123,12 @@ export default defineComponent({
}
}
async function lista_Aggiornata() {
myCatalog.value.data_lista_updated = tools.getDateNow();
myCatalog.value.username_lista_updated = userStore.my.username;
await saveCatalog();
}
async function saveCatalog() {
const catalog = myCatalog.value;
const mydata = {
@@ -1519,6 +1525,8 @@ export default defineComponent({
const productIds = myarr.map((product) => product._id);
let mydata = {
data_lista_updated: tools.getDateNow(),
username_lista_updated: userStore.my.username,
lista_prodotti: productIds,
};
@@ -1535,6 +1543,8 @@ export default defineComponent({
if (ricarica) {
generatearrProdToViewSorted(true, false);
}
// lista_Aggiornata();
}
/*function getProducts() {
@@ -2509,7 +2519,6 @@ export default defineComponent({
catalog.data_generato = tools.getDateNow();
}
} else {
strout.value = JSON.stringify(ris, null, 2);
}

View File

@@ -11,7 +11,7 @@
v-if="
ispageCatalogata &&
!optcatalogo.showOnlyCatalogoPDF &&
(tools.isEditor() || tools.isCommerciale()) &&
(tools.isCollaboratore()) &&
myCatalog?.referenti?.length > 0
"
class="text-h7 text-center text-red q-ma-sm"
@@ -183,7 +183,7 @@
</q-inner-loading>
<q-btn
v-if="!showListaFiltrata && (tools.isEditor() || tools.isCommerciale())"
v-if="!showListaFiltrata && (tools.isCollaboratore())"
rounded
icon="fas fa-redo"
label="Rigenera Lista"