mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 08:56:48 +01:00
Salvataggio delle firme in JPG
This commit is contained in:
parent
a91c9e8a1a
commit
b95fa70015
@ -563,7 +563,7 @@ switch (post('op')) {
|
||||
if (directory($docroot.'/files/interventi')) {
|
||||
if (post('firma_base64') != '') {
|
||||
// Salvataggio firma
|
||||
$firma_file = 'firma_'.time().'.png';
|
||||
$firma_file = 'firma_'.time().'.jpg';
|
||||
$firma_nome = post('firma_nome');
|
||||
|
||||
$data = explode(',', post('firma_base64'));
|
||||
|
@ -49,7 +49,7 @@ if (get('anteprima') !== null) {
|
||||
}
|
||||
|
||||
?>
|
||||
<form class="canvas" action="<?php echo $rootdir ?>/editor.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>" method="post" id="form-firma">
|
||||
<form class="canvas" action="<?php echo $rootdir; ?>/editor.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>" method="post" id="form-firma">
|
||||
<input type="hidden" name="op" value="firma">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
|
||||
@ -90,7 +90,9 @@ if (get('anteprima') !== null) {
|
||||
saveButton = document.querySelector("[data-action=save]"),
|
||||
canvas = document.getElementById("canvas");
|
||||
|
||||
var signaturePad = new SignaturePad(canvas);
|
||||
var signaturePad = new SignaturePad(canvas, {
|
||||
backgroundColor: 'rgb(255,255,255)'
|
||||
});
|
||||
|
||||
function resizeCanvas() {
|
||||
image_data = signaturePad.toDataURL();
|
||||
@ -115,7 +117,7 @@ if (get('anteprima') !== null) {
|
||||
if (signaturePad.isEmpty()) {
|
||||
alert("Please provide signature first.");
|
||||
} else {
|
||||
image_data = signaturePad.toDataURL();
|
||||
image_data = signaturePad.toDataURL("image/jpeg", 100);
|
||||
$('#firma_base64').val(image_data);
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user