feat: contatore tempo allocato, pagina miei ticket, unione ticket (da db)
This commit is contained in:
@@ -45,7 +45,7 @@ const TicketCreateView = {
|
||||
company_search: document.getElementById('create-company-search').value,
|
||||
priority_id: document.getElementById('create-priority').value,
|
||||
subject: document.getElementById('create-subject').value,
|
||||
body: document.getElementById('create-body').value,
|
||||
body: this.quill ? this.quill.root.innerHTML : '',
|
||||
isAdvancedVisible: document.getElementById('advanced-options').style.display !== 'none'
|
||||
};
|
||||
},
|
||||
@@ -192,7 +192,9 @@ const TicketCreateView = {
|
||||
|
||||
<div class="form-group full-width">
|
||||
<label class="form-label">Messaggio / Nota iniziale</label>
|
||||
<textarea class="form-textarea" id="create-body" placeholder="Descrivi il problema in dettaglio..."></textarea>
|
||||
<div id="create-body-container" style="background: var(--bg-tertiary); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden;">
|
||||
<div id="create-body-editor" style="min-height: 200px; font-family: inherit; font-size: 0.95rem; border: none; color: var(--text-primary);"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -221,6 +223,30 @@ const TicketCreateView = {
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Initialize Quill Editor
|
||||
if (window.Quill) {
|
||||
this.quill = new Quill('#create-body-editor', {
|
||||
theme: 'snow',
|
||||
placeholder: 'Descrivi il problema in dettaglio...',
|
||||
modules: {
|
||||
toolbar: [
|
||||
['bold', 'italic', 'underline', 'strike'],
|
||||
[{ 'header': [1, 2, 3, false] }],
|
||||
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
|
||||
['link', 'image'],
|
||||
['clean']
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
// Set saved body/state if available
|
||||
if (this.savedState && this.savedState.body) {
|
||||
this.quill.root.innerHTML = this.savedState.body;
|
||||
}
|
||||
} else {
|
||||
this.quill = null;
|
||||
}
|
||||
|
||||
this.bindEvents();
|
||||
|
||||
} catch (err) {
|
||||
@@ -607,7 +633,7 @@ const TicketCreateView = {
|
||||
customer_id: customerId || undefined,
|
||||
customer_user_id: customerUserId || undefined,
|
||||
subject: document.getElementById('create-subject').value.trim() || undefined,
|
||||
body: document.getElementById('create-body').value.trim() || undefined,
|
||||
body: this.quill ? this.quill.root.innerHTML.trim() : undefined,
|
||||
attachments: this.attachments.length > 0 ? this.attachments : undefined
|
||||
};
|
||||
|
||||
@@ -624,6 +650,9 @@ const TicketCreateView = {
|
||||
this.savedState = null; // Clear cached state on success
|
||||
this.attachments = []; // Clear attachments array
|
||||
|
||||
// Update daily timer
|
||||
App.updateDailyTimer();
|
||||
|
||||
// Navigate to the new ticket
|
||||
window.location.hash = `#/tickets/${result.id}`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user