fix: aggiunta nota ticket unito. feat: possiblità di visualizzare ticket in schede. feat: possibilità di creare un nuovo gruppo dall'interfaccia del ticket.
This commit is contained in:
@@ -109,6 +109,7 @@ const TicketListView = {
|
||||
</div>
|
||||
<button class="btn btn-primary btn-sm" id="batch-apply">Applica</button>
|
||||
<button class="btn btn-primary btn-sm" id="batch-merge" disabled style="background: var(--accent-secondary); border-color: var(--accent-secondary); margin-left: 8px;">Unisci Selezionati</button>
|
||||
<button class="btn btn-primary btn-sm" id="batch-open-tabs" disabled style="background: var(--accent-primary); border-color: var(--accent-primary); margin-left: 8px;">Apri ticket in schede</button>
|
||||
<button class="btn btn-ghost btn-xs" id="batch-cancel">Annulla</button>
|
||||
</div>
|
||||
|
||||
@@ -147,6 +148,7 @@ const TicketListView = {
|
||||
<span style="display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; background:#1070ca; color:#fff; border-radius:50%; font-size:10px; font-weight:800; font-family:sans-serif; margin-left:6px; vertical-align:middle; line-height:16px;">O</span>
|
||||
</a>
|
||||
` : ''}
|
||||
<button class="open-tab-btn" data-id="${t.id}" data-tn="${t.tn}" data-title="${App.escapeHtml(t.title || '')}" onclick="App.openTab(${t.id}, '${t.tn}', this.dataset.title); event.stopPropagation();" title="Apri in scheda" style="display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; background:var(--accent-primary); color:#fff; border:none; border-radius:50%; font-size:10px; font-weight:800; font-family:sans-serif; margin-left:6px; cursor:pointer; line-height:16px;">+</button>
|
||||
</span>
|
||||
</td>
|
||||
<td style="color:var(--text-tertiary);font-size:0.78rem;">${App.formatDateTime(t.create_time)}</td>
|
||||
@@ -304,6 +306,39 @@ const TicketListView = {
|
||||
batchMerge.addEventListener('click', () => this.mergeBatch());
|
||||
}
|
||||
|
||||
// Batch open tabs
|
||||
const batchOpenTabsBtn = document.getElementById('batch-open-tabs');
|
||||
if (batchOpenTabsBtn) {
|
||||
batchOpenTabsBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
if (this.selectedIds.size === 0) return;
|
||||
|
||||
let count = 0;
|
||||
this.selectedIds.forEach(id => {
|
||||
const row = document.querySelector(`.ticket-table tbody tr[data-ticket-id="${id}"]`);
|
||||
if (row) {
|
||||
const tnLink = row.querySelector('.ticket-tn-link');
|
||||
const titleLink = row.querySelector('.ticket-title-link');
|
||||
const tn = tnLink ? tnLink.textContent.trim() : '';
|
||||
const title = titleLink ? titleLink.textContent.trim() : '';
|
||||
App.openTab(parseInt(id, 10), tn, title);
|
||||
count++;
|
||||
}
|
||||
});
|
||||
|
||||
if (count > 0) {
|
||||
Toast.success(`${count} ticket aperti in nuove schede!`);
|
||||
this.selectedIds.clear();
|
||||
this.selectedOrder = [];
|
||||
document.querySelectorAll('.ticket-table tbody tr').forEach(tr => {
|
||||
tr.classList.remove('selected');
|
||||
tr.classList.remove('first-selected');
|
||||
});
|
||||
this.updateBatchBar();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Batch Copy Ticket Numbers
|
||||
const batchCopyTns = document.getElementById('batch-copy-tns');
|
||||
if (batchCopyTns) {
|
||||
@@ -505,6 +540,16 @@ const TicketListView = {
|
||||
mergeBtn.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Enable/disable open tabs button
|
||||
const openTabsBtn = document.getElementById('batch-open-tabs');
|
||||
if (openTabsBtn) {
|
||||
if (this.selectedIds.size > 0) {
|
||||
openTabsBtn.disabled = false;
|
||||
} else {
|
||||
openTabsBtn.disabled = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async applyBatch() {
|
||||
|
||||
Reference in New Issue
Block a user