diff --git a/public/js/views/ticketList.js b/public/js/views/ticketList.js index b5b5f39..13f66ab 100644 --- a/public/js/views/ticketList.js +++ b/public/js/views/ticketList.js @@ -100,6 +100,13 @@ const TicketListView = { ${(App.lookups.users || []).map(u => ``).join('')} +
+ Responsabile + +
Cliente @@ -429,6 +436,8 @@ const TicketListView = { if (batchQueue) batchQueue.value = ''; const batchOwner = document.getElementById('batch-owner'); if (batchOwner) batchOwner.value = ''; + const batchResponsible = document.getElementById('batch-responsible'); + if (batchResponsible) batchResponsible.value = ''; this.updateBatchBar(); }); @@ -559,6 +568,7 @@ const TicketListView = { const batchState = document.getElementById('batch-state')?.value; const batchQueue = document.getElementById('batch-queue')?.value; const batchOwner = document.getElementById('batch-owner')?.value; + const batchResponsible = document.getElementById('batch-responsible')?.value; const batchCustomerSearch = document.getElementById('batch-customer-search')?.value.trim(); let batchCustomerUserId = document.getElementById('batch-customer-user-id')?.value; let batchCustomerId = document.getElementById('batch-customer-id')?.value; @@ -573,6 +583,11 @@ const TicketListView = { if (batchState) updates.ticket_state_id = parseInt(batchState); if (batchQueue) updates.queue_id = parseInt(batchQueue); if (batchOwner) updates.user_id = parseInt(batchOwner); + if (batchResponsible) { + updates.responsible_user_id = parseInt(batchResponsible); + } else if (batchOwner) { + updates.responsible_user_id = parseInt(batchOwner); + } if (batchCustomerUserId) updates.customer_user_id = batchCustomerUserId; if (batchCustomerId) updates.customer_id = batchCustomerId; diff --git a/routes/tickets.js b/routes/tickets.js index 22d7143..ec930f7 100644 --- a/routes/tickets.js +++ b/routes/tickets.js @@ -1418,6 +1418,7 @@ router.patch('/batch/update', async (req, res) => { if (updates.ticket_priority_id !== undefined) ticketFields.PriorityID = updates.ticket_priority_id; if (updates.queue_id !== undefined) ticketFields.QueueID = updates.queue_id; if (updates.user_id !== undefined) ticketFields.OwnerID = updates.user_id; + if (updates.responsible_user_id !== undefined) ticketFields.ResponsibleID = updates.responsible_user_id; if (updates.customer_id !== undefined) ticketFields.CustomerID = updates.customer_id; if (updates.customer_user_id !== undefined) ticketFields.CustomerUser = updates.customer_user_id; @@ -1470,7 +1471,7 @@ router.patch('/batch/update', async (req, res) => { try { await client.query('BEGIN'); - const allowedFields = ['ticket_state_id', 'ticket_priority_id', 'queue_id', 'user_id', 'customer_id', 'customer_user_id']; + const allowedFields = ['ticket_state_id', 'ticket_priority_id', 'queue_id', 'user_id', 'responsible_user_id', 'customer_id', 'customer_user_id']; const setClauses = []; const setParams = []; let pIdx = 1;