mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Salvataggio delle firme in JPG
This commit is contained in:
@@ -563,7 +563,7 @@ switch (post('op')) {
|
|||||||
if (directory($docroot.'/files/interventi')) {
|
if (directory($docroot.'/files/interventi')) {
|
||||||
if (post('firma_base64') != '') {
|
if (post('firma_base64') != '') {
|
||||||
// Salvataggio firma
|
// Salvataggio firma
|
||||||
$firma_file = 'firma_'.time().'.png';
|
$firma_file = 'firma_'.time().'.jpg';
|
||||||
$firma_nome = post('firma_nome');
|
$firma_nome = post('firma_nome');
|
||||||
|
|
||||||
$data = explode(',', post('firma_base64'));
|
$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="op" value="firma">
|
||||||
<input type="hidden" name="backto" value="record-edit">
|
<input type="hidden" name="backto" value="record-edit">
|
||||||
|
|
||||||
@@ -90,7 +90,9 @@ if (get('anteprima') !== null) {
|
|||||||
saveButton = document.querySelector("[data-action=save]"),
|
saveButton = document.querySelector("[data-action=save]"),
|
||||||
canvas = document.getElementById("canvas");
|
canvas = document.getElementById("canvas");
|
||||||
|
|
||||||
var signaturePad = new SignaturePad(canvas);
|
var signaturePad = new SignaturePad(canvas, {
|
||||||
|
backgroundColor: 'rgb(255,255,255)'
|
||||||
|
});
|
||||||
|
|
||||||
function resizeCanvas() {
|
function resizeCanvas() {
|
||||||
image_data = signaturePad.toDataURL();
|
image_data = signaturePad.toDataURL();
|
||||||
@@ -115,7 +117,7 @@ if (get('anteprima') !== null) {
|
|||||||
if (signaturePad.isEmpty()) {
|
if (signaturePad.isEmpty()) {
|
||||||
alert("Please provide signature first.");
|
alert("Please provide signature first.");
|
||||||
} else {
|
} else {
|
||||||
image_data = signaturePad.toDataURL();
|
image_data = signaturePad.toDataURL("image/jpeg", 100);
|
||||||
$('#firma_base64').val(image_data);
|
$('#firma_base64').val(image_data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user