82 lines
2.2 KiB
JavaScript
Executable File
82 lines
2.2 KiB
JavaScript
Executable File
$(document).ready(function() {
|
|
$('#addr_email').scombobox({
|
|
fullMatch : false,
|
|
invalidAsValue: true
|
|
// when fullMatch is true
|
|
// then highligh is also true by default
|
|
});
|
|
$('#addr_email').css('width','250px');
|
|
$('.scombobox-display').css('width','250px');
|
|
|
|
});
|
|
|
|
var sendMailAjax = function(pdf_opt) {
|
|
|
|
var params = new Array;
|
|
params[0] = $("#form :input[name='module']").val();
|
|
params[1] = $("input[name='record']").val();
|
|
params[2] = $(".scombobox-display").val();
|
|
params[3] = $("#textarea").val();
|
|
params[4] = pdf_opt;
|
|
$(".loading_panel").css("display", "block");
|
|
|
|
jQuery.ajax({
|
|
type : 'POST',
|
|
url : 'index.php?entryPoint=HandleEcmAjax',
|
|
data : {
|
|
ecmclass : 'EcmSendPdfButton',
|
|
job : 'sendEmailAjaxWithDocument',
|
|
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
|
},
|
|
dataType : 'json',
|
|
async : false,
|
|
success : function(response) {
|
|
console.log(response);
|
|
if(response==1){
|
|
$('#sendreturn').html('Wiadomość email została wysłana!');
|
|
$('#sendreturn').show();
|
|
} else {
|
|
$('#sendreturn').html('<p style="color:red;">Wiadomość email NIE została wysłana!</p>');
|
|
$('#sendreturn').show();
|
|
}
|
|
return;
|
|
},
|
|
error : function(xhr, ajaxOptions, thrownError) {
|
|
console.log(thrownError);
|
|
}
|
|
});
|
|
$(".loading_panel").css("display", "none");
|
|
$('#div_send').hide();
|
|
}
|
|
/*
|
|
function sendMailAjax() {
|
|
var ajax_url = "index.php?module=EcmSales&action=javahelper&to_pdf=1";
|
|
$(".loading_panel").css("display", "block");
|
|
var params = {
|
|
job : 'SendMail',
|
|
id : id,
|
|
modulee : modulee,
|
|
parent_id : parent_id,
|
|
};
|
|
$
|
|
.ajax({
|
|
type : "POST",
|
|
url : ajax_url,
|
|
dataType : "json",
|
|
async : false,
|
|
success : function(data) {
|
|
if (data != '-1') {
|
|
|
|
$("#sendreturn").text(
|
|
'Email z dokumentem został wysłany!');
|
|
$("#sendreturn").show();
|
|
} else {
|
|
$("#sendreturn").text(
|
|
'Email z dokumentem nie został wysłany!');
|
|
$("#sendreturn").show();
|
|
}
|
|
},
|
|
data : params
|
|
});
|
|
$(".loading_panel").css("display", "none");
|
|
}*/ |