mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Añadida funcionalidad de modal de confirmacion _modalConfirmDialog
This commit is contained in:
@ -6,6 +6,6 @@ return [
|
|||||||
'papel_impresion_maquinas' => 'Papeles impresion',
|
'papel_impresion_maquinas' => 'Papeles impresion',
|
||||||
'activo' => 'Activo',
|
'activo' => 'Activo',
|
||||||
'gramaje_duplicado' => 'No se pueden seleccionar dos papeles con el mismo gramaje',
|
'gramaje_duplicado' => 'No se pueden seleccionar dos papeles con el mismo gramaje',
|
||||||
'sureToChangeRotativaTitle' => 'Está seguro de cambiar esta opción?',
|
'sureToChangeRotativaTitle' => '¿Está seguro de cambiar esta opción?',
|
||||||
'sureToChangeRotativaText' => 'Está operación no se puede deshacer y cambiará la lista de papeles.',
|
'sureToChangeRotativaText' => 'Está operación no se puede deshacer y cambiará la lista de papeles.',
|
||||||
];
|
];
|
||||||
@ -37,7 +37,7 @@ return [
|
|||||||
|
|
||||||
'consumo_tintas_rotativas' => 'Consumo tintas rotativas',
|
'consumo_tintas_rotativas' => 'Consumo tintas rotativas',
|
||||||
'maquinas_papel' => 'Máquinas seleccionadas',
|
'maquinas_papel' => 'Máquinas seleccionadas',
|
||||||
'sureToChangeRotativaTitle' => 'Está seguro de cambiar esta opción?',
|
'sureToChangeRotativaTitle' => '¿Está seguro de cambiar esta opción?',
|
||||||
'sureToChangeRotativaText' => 'Está operación no se puede deshacer, cambiará la lista de máquinas y el consumo de tintas.',
|
'sureToChangeRotativaText' => 'Está operación no se puede deshacer, cambiará la lista de máquinas y el consumo de tintas.',
|
||||||
|
|
||||||
'validation' => [
|
'validation' => [
|
||||||
|
|||||||
@ -0,0 +1,45 @@
|
|||||||
|
<div id="modalConfirmYesNo" class="modal fade">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 id="labelTitleConfirmDialog" class="modal-title"></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p id="labelMsgConfirmDialog"></p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button id="btnYesConfirmDialog"
|
||||||
|
type="button"
|
||||||
|
class="btn btn-primary"
|
||||||
|
><?= lang('Basic.global.yes') ?></button>
|
||||||
|
<button id="btnNoConfirmDialog"
|
||||||
|
type="button"
|
||||||
|
class="btn btn-default"
|
||||||
|
><?= lang('Basic.global.Cancel') ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?= $this->section('additionalInlineJs') ?>
|
||||||
|
|
||||||
|
|
||||||
|
function asyncConfirmDialog(title, msg, yesCallbackFn, noCallbackFn) {
|
||||||
|
var $confirmDialog = $("#modalConfirmYesNo");
|
||||||
|
$confirmDialog.modal('show');
|
||||||
|
$("#labelTitleConfirmDialog").html(title);
|
||||||
|
$("#labelMsgConfirmDialog").html(msg);
|
||||||
|
$("#btnYesConfirmDialog").off('click').click(function () {
|
||||||
|
yesCallbackFn();
|
||||||
|
$confirmDialog.modal("hide");
|
||||||
|
});
|
||||||
|
$("#btnNoConfirmDialog").off('click').click(function () {
|
||||||
|
noCallbackFn();
|
||||||
|
$confirmDialog.modal("hide");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
@ -1,72 +0,0 @@
|
|||||||
|
|
||||||
<div id="modalConfirmYesNo" class="modal fade">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button"
|
|
||||||
class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<h4 id="lblTitleConfirmYesNo" class="modal-title">Confirmation</h4>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<p id="lblMsgConfirmYesNo"></p>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button id="btnYesConfirmYesNo"
|
|
||||||
type="button" class="btn btn-primary">Yes</button>
|
|
||||||
<button id="btnNoConfirmYesNo"
|
|
||||||
type="button" class="btn btn-default">No</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('additionalInlineJs') ?>
|
|
||||||
|
|
||||||
function popAlert(message, alertClass, alertIcon){
|
|
||||||
var htmlString = `
|
|
||||||
<div class="alert ${alertClass} d-flex align-items-baseline" role="alert">
|
|
||||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
||||||
<i class="ti ${alertIcon} ti-sm"></i>
|
|
||||||
</span>
|
|
||||||
<div class="d-flex flex-column ps-1">
|
|
||||||
<h5 class="alert-heading mb-2">${message}</h5>
|
|
||||||
</div>
|
|
||||||
</div>`;
|
|
||||||
$(window).scrollTop(0);
|
|
||||||
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
|
|
||||||
setTimeout(function(){
|
|
||||||
$('#sk-alert').fadeOut("slow");
|
|
||||||
}, 5000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function popSuccessAlert(successMsg){
|
|
||||||
popAlert(successMsg, "alert-success", "ti-check");
|
|
||||||
}
|
|
||||||
|
|
||||||
function popWarningAlert(warningMsg){
|
|
||||||
popAlert(warningMsg, "alert-warning", "ti-bell");
|
|
||||||
}
|
|
||||||
|
|
||||||
function popErrorAlert(errorMsg){
|
|
||||||
popAlert(errorMsg, "alert-danger", "ti-ban");
|
|
||||||
}
|
|
||||||
|
|
||||||
<?php if (isset($successMessage) && $successMessage){ ?>
|
|
||||||
popSuccessAlert(`<?= $successMessage ?>`);
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?php if (isset($warningMessage) && $warningMessage){ ?>
|
|
||||||
popWarningAlert(`<?= $warningMessage ?>`);
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?php if (isset($errorMessage) && $errorMessage){ ?>
|
|
||||||
popErrorAlert(`<?= $errorMessage ?>`);
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
|
|
||||||
|
|
||||||
@ -98,10 +98,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- //.accordion -->
|
</div> <!-- //.accordion -->
|
||||||
|
|
||||||
|
<?= view("themes/_commonPartialsBs/_modalConfirmDialog") ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
@ -141,73 +146,37 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#isRotativa').on("click",function(el){
|
$('#isRotativa').on("click",function(el){
|
||||||
|
asyncConfirmDialog('<?= lang('MaquinasPapelImpresion.sureToChangeRotativaTitle') ?>',
|
||||||
AsyncConfirmYesNo('title', 'msg', MyYesFunction, MyNoFunction);
|
'<?= lang('MaquinasPapelImpresion.sureToChangeRotativaText') ?>', yesCallback, noCallback);
|
||||||
|
|
||||||
/*Swal.fire({
|
|
||||||
title: '<?= lang('MaquinasPapelImpresion.sureToChangeRotativaTitle') ?>',
|
|
||||||
text: '<?= lang('MaquinasPapelImpresion.sureToChangeRotativaText') ?>',
|
|
||||||
icon: 'warning',
|
|
||||||
showCancelButton: true,
|
|
||||||
confirmButtonColor: '#3085d6',
|
|
||||||
confirmButtonText: '<?= lang('Basic.global.yes') ?>',
|
|
||||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
|
||||||
cancelButtonColor: '#d33'
|
|
||||||
})
|
|
||||||
.then((result) => {
|
|
||||||
if (result.value) {
|
|
||||||
|
|
||||||
if($(this).is(':checked')){
|
|
||||||
isRotativa.watch = 1;
|
|
||||||
$("#datosRotativa").show();
|
|
||||||
}else{
|
|
||||||
document.getElementById("precioTintaNegro").value = null;
|
|
||||||
document.getElementById("precioTintaColor").value = null;
|
|
||||||
document.getElementById("velocidadCorte").value = null;
|
|
||||||
document.getElementById("precioHoraCorte").value = null;
|
|
||||||
document.getElementById("metrosxminuto").value = null;
|
|
||||||
$("#datosRotativa").hide();
|
|
||||||
isRotativa.watch = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
theTable2.clearPipeline();
|
|
||||||
theTable2.draw();
|
|
||||||
yeniden(response.<?= csrf_token() ?>);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function AsyncConfirmYesNo(title, msg, yesFn, noFn) {
|
function yesCallback() {
|
||||||
var $confirm = $("#modalConfirmYesNo");
|
if($('#isRotativa').is(':checked')){
|
||||||
$confirm.modal('show');
|
isRotativa.watch = 1;
|
||||||
$("#lblTitleConfirmYesNo").html(title);
|
$("#datosRotativa").show();
|
||||||
$("#lblMsgConfirmYesNo").html(msg);
|
}else{
|
||||||
$("#btnYesConfirmYesNo").off('click').click(function () {
|
document.getElementById("precioTintaNegro").value = 0;
|
||||||
yesFn();
|
document.getElementById("precioTintaColor").value = 0;
|
||||||
$confirm.modal("hide");
|
document.getElementById("velocidadCorte").value = 0;
|
||||||
});
|
document.getElementById("precioHoraCorte").value = 0;
|
||||||
$("#btnNoConfirmYesNo").off('click').click(function () {
|
document.getElementById("metrosxminuto").value = 0;
|
||||||
noFn();
|
$("#datosRotativa").hide();
|
||||||
$confirm.modal("hide");
|
isRotativa.watch = 0;
|
||||||
});
|
}
|
||||||
|
theTable2.clearPipeline();
|
||||||
|
theTable2.draw();
|
||||||
|
//yeniden(response.<?= csrf_token() ?>); esto da error JJO?
|
||||||
}
|
}
|
||||||
|
|
||||||
function MyYesFunction() {
|
function noCallback() {
|
||||||
alert("Time to get off your workstation!");
|
// Toggle behaviour
|
||||||
$("#lblTestResult").html("You are hungry");
|
$('#isRotativa').prop("checked", !$('#isRotativa').prop("checked"));
|
||||||
}
|
|
||||||
function MyNoFunction() {
|
|
||||||
alert("Well... just continue working.");
|
|
||||||
$("#lblTestResult").html("You are not hungry");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#isPadre').on("click",function(el){
|
$('#isPadre').on("click",function(el){
|
||||||
if($(this).is(':checked')){
|
if($(this).is(':checked')){
|
||||||
|
|
||||||
$("#selectVariante").show();
|
$("#selectVariante").show();
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$("#padreId").select2('val', -1);
|
$("#padreId").select2('val', -1);
|
||||||
$("#selectVariante").hide();
|
$("#selectVariante").hide();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user