mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado tickets. faltan respuestas
This commit is contained in:
@ -1,20 +1,6 @@
|
||||
import Table from '../../components/table.js';
|
||||
import Ajax from '../../components/ajax.js';
|
||||
|
||||
/*$(function () {
|
||||
|
||||
|
||||
|
||||
/*
|
||||
document.querySelectorAll('[data-bs-toggle="lightbox"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
const imgSrc = this.getAttribute('href');
|
||||
document.getElementById('lightboxImage').src = imgSrc;
|
||||
new bootstrap.Modal(document.getElementById('lightboxModal')).show();
|
||||
});
|
||||
});
|
||||
});*/
|
||||
|
||||
|
||||
class Ticket {
|
||||
@ -37,6 +23,12 @@ class Ticket {
|
||||
init() {
|
||||
|
||||
if(this.action == "edit") {
|
||||
|
||||
$('.gallery-img').on('click', function() {
|
||||
let imageUrl = $(this).data('src'); // Obtiene la URL de la imagen
|
||||
$('#modalImage').attr('src', imageUrl); // Cambia la imagen en el modal
|
||||
$('#imageModal').modal('show'); // Muestra el modal
|
||||
});
|
||||
|
||||
}
|
||||
else if (this.action == "list") {
|
||||
@ -51,16 +43,44 @@ class Ticket {
|
||||
const actions = ['view'];
|
||||
const columns = [
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'categoria_id' },
|
||||
{ 'data': 'seccion_id' },
|
||||
{ 'data': 'estado_id' },
|
||||
{ 'data': 'prioridad' },
|
||||
{ 'data': 'categoria_id',
|
||||
render: function (data, type, row) {
|
||||
return window.language.Tickets[row.categoria];
|
||||
}
|
||||
},
|
||||
{ 'data': 'seccion_id' ,
|
||||
render: function (data, type, row) {
|
||||
return window.language.Tickets[row.seccion];
|
||||
}
|
||||
},
|
||||
{ 'data': 'estado_id' ,
|
||||
render: function (data, type, row) {
|
||||
return window.language.Tickets[row.estado];
|
||||
}
|
||||
},
|
||||
{ 'data': 'prioridad' ,
|
||||
render: function (data, type, row) {
|
||||
return window.language.Tickets[data];
|
||||
},
|
||||
visible: false,
|
||||
},
|
||||
{ 'data': 'titulo' },
|
||||
{ 'data': 'usuario_id' },
|
||||
{ 'data': 'user_soporte_id' },
|
||||
{ 'data': 'usuario_id' ,
|
||||
render: function (data, type, row) {
|
||||
return row.usuario;
|
||||
},
|
||||
visible: false,
|
||||
},
|
||||
{ 'data': 'user_soporte_id',
|
||||
render: function (data, type, row) {
|
||||
return row.user_soporte;
|
||||
},
|
||||
visible: false,
|
||||
},
|
||||
{ 'data': 'created_at' },
|
||||
];
|
||||
|
||||
|
||||
this.table = new Table(
|
||||
$('#tableOfTickets'),
|
||||
'tickets',
|
||||
@ -68,15 +88,29 @@ class Ticket {
|
||||
columns,
|
||||
);
|
||||
|
||||
|
||||
this.table.init({
|
||||
actions: actions,
|
||||
buttonsExport: true,
|
||||
});
|
||||
|
||||
this.table.table.on('init.dt', function () {
|
||||
self.table.table.page.len(50).draw();
|
||||
if(window.userType==1){
|
||||
|
||||
this.tableTarifas.table.on('init.dt', function () {
|
||||
self.tableTarifas.table.page.len(50).draw();
|
||||
self.table.table.column(4).visible(true);
|
||||
self.table.table.column(6).visible(true);
|
||||
self.table.table.column(7).visible(true);
|
||||
|
||||
self.table.table.column(4).header().style.display = 'table-cell';
|
||||
self.table.table.column(6).header().style.display = 'table-cell';
|
||||
self.table.table.column(7).header().style.display = 'table-cell';
|
||||
}
|
||||
});
|
||||
|
||||
this.table.setEditCallback(function(id){
|
||||
window.location.href = '/soporte/edit/' + id;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user