Files
crm.twinpol.com/include/jQuery/printerScripts.js

62 lines
1.5 KiB
JavaScript
Raw Normal View History

2025-05-12 15:45:17 +00:00
function checkPrint(module,id, pdf_opt){
$('#sendreturn').html('Sprawdzam drukarkę...<img src="include/SugarFields/Fields/File/gif-load.gif">');
$('#PrinterDivList').hide();
$('#sendreturn').show();
var params = {
job : 'justPrinterCheck',
recid : id,
printer : $('#PrinterSelectList').val(),
check : '1',
type: $('#pdfPrintType').val(),
};
$.ajax({
type : "POST",
url : 'index.php?entryPoint=uploadAjaxFile',
dataType : "html",
async : false,
success : function(data) {
if (data == 'false') {
$('#sendreturn').html('Sprawdz czy drukarka jest włączona lub konfigurację!');
} else {
$('#sendreturn').html('Trwa drukowanie dokumentu...<img src="include/SugarFields/Fields/File/gif-load.gif">');
justPrint(module,id, pdf_opt);
}
//$(".loading_panel").css("display", "none");
},
data : params
});
}
function justPrint(module,id, pdf_opt){
var params = {
job : 'justPrinterCheck',
recid : id,
printer : $('#PrinterSelectList').val(),
check : '0',
type: $('#pdfPrintType').val(),
module: module,
pdf_opt: pdf_opt,
};
$.ajax({
type : "POST",
url : 'index.php?entryPoint=uploadAjaxFile',
dataType : "html",
async : false,
success : function(data) {
if (data == 'false') {
$('#sendreturn').html('Nie można wydrukować dokumentu!');
} else {
$('#sendreturn').html('Polecenie drukowania zlecone!');
}
},
data : params
});
}