DV Thanato : add tampon and signature on pdf attestations
This commit is contained in:
parent
de0ed31ccb
commit
aa71d04f17
@ -64,6 +64,21 @@ class CertificateService {
|
||||
}
|
||||
return $signatureExist;
|
||||
}
|
||||
private function tamponImageExist(){
|
||||
$storage = $this->rootFolder->getUserFolder(self::DEFAULT_NEXTCLOUD_ADMIN);
|
||||
try{
|
||||
if(isset($storage)){
|
||||
$storage->get("/.gestion/sign.jpg"); // tampon image
|
||||
$signatureExist = true;
|
||||
}else{
|
||||
$signatureExist = false;
|
||||
}
|
||||
}
|
||||
catch(\OCP\Files\NotFoundException $e) {
|
||||
$signatureExist = false;
|
||||
}
|
||||
return $signatureExist;
|
||||
}
|
||||
|
||||
private function getLogo(){
|
||||
$storage = $this->rootFolder->getUserFolder(self::DEFAULT_NEXTCLOUD_ADMIN);
|
||||
@ -138,7 +153,8 @@ class CertificateService {
|
||||
$pdf->AddFont('ComicSans','','Comic Sans MS.php');
|
||||
$pdf->AddFont('ComicSans','B','comic-sans-bold.php');
|
||||
$signatureImageExist = $this->signatureImageExists();
|
||||
$pdf->SetCareCertificateData($devisOfDefunt,$logo,$signatureImageExist);
|
||||
$tamponImageExist = $this->tamponImageExist();
|
||||
$pdf->SetCareCertificateData($devisOfDefunt,$logo,$signatureImageExist ,$tamponImageExist);
|
||||
$pdf->SetCareCertificate();
|
||||
try {
|
||||
$storage->newFolder($folderDestination);
|
||||
@ -202,7 +218,8 @@ class CertificateService {
|
||||
$pdf->AddFont('ComicSans','','Comic Sans MS.php');
|
||||
$pdf->AddFont('ComicSans','B','comic-sans-bold.php');
|
||||
$signatureImageExist = $this->signatureImageExists();
|
||||
$pdf->SetPacemakerCertificateData($devisOfDefunt,$logo,$signatureImageExist);
|
||||
$tamponImageExist = $this->tamponImageExist();
|
||||
$pdf->SetPacemakerCertificateData($devisOfDefunt,$logo,$signatureImageExist ,$tamponImageExist);
|
||||
$pdf->SetPacemakerCertificate();
|
||||
try {
|
||||
$storage->newFolder($folderDestination);
|
||||
|
||||
@ -37,6 +37,7 @@ class CareCertificatePdfHandler extends FPDF {
|
||||
private $devisOfDefunt = [];
|
||||
private $logo = null;
|
||||
private $signatureImageExist = false;
|
||||
private $tamponImageExist = false;
|
||||
private $imagePath = "/var/www/html/data/admin/files/.gestion/";
|
||||
|
||||
function Header()
|
||||
@ -56,10 +57,11 @@ class CareCertificatePdfHandler extends FPDF {
|
||||
$this->MultiCell(0, 5, utf8_decode(html_entity_decode($this->devisOfDefunt['configuration']->adresse)), 0,'C');
|
||||
}
|
||||
|
||||
public function SetCareCertificateData(array $devisOfDefunt,$logo = null,$signatureImageExist = false){
|
||||
public function SetCareCertificateData(array $devisOfDefunt,$logo = null,$signatureImageExist = false , $tamponImageExist = false){
|
||||
$this->devisOfDefunt = $devisOfDefunt;
|
||||
$this->logo = $logo;
|
||||
$this->signatureImageExist = $signatureImageExist;
|
||||
$this->tamponImageExist = $tamponImageExist;
|
||||
}
|
||||
|
||||
public function SetCareCertificate(){
|
||||
@ -74,8 +76,12 @@ class CareCertificatePdfHandler extends FPDF {
|
||||
$this->SetXY(140,$this->GetY() + 15);
|
||||
$this->Cell(0,10,'Cachet et signature');
|
||||
|
||||
if($this->tamponImageExist){
|
||||
$this->Image($this->imagePath."sign.jpg", 120, $this->GetY() + 8, 80, 35);
|
||||
}
|
||||
|
||||
if($this->signatureImageExist){
|
||||
$this->Image($this->imagePath."sign.png", 135, $this->GetY() + 12, 60, 40);
|
||||
$this->Image($this->imagePath."sign.png", 140, $this->GetY() + 40, 40, 16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ class PacemakerCertificatePdfHandler extends FPDF
|
||||
private $devisOfDefunt = [];
|
||||
private $logo = null;
|
||||
private $signatureImageExist = false;
|
||||
private $tamponImageExist = false;
|
||||
private $imagePath = "/var/www/html/data/admin/files/.gestion/";
|
||||
|
||||
function Header()
|
||||
@ -56,11 +57,12 @@ class PacemakerCertificatePdfHandler extends FPDF
|
||||
$this->MultiCell(0, 5, utf8_decode(html_entity_decode($this->devisOfDefunt['configuration']->adresse)), 0, 'C');
|
||||
}
|
||||
|
||||
public function SetPacemakerCertificateData(array $devisOfDefunt, $logo = null, $signatureImageExist = false)
|
||||
public function SetPacemakerCertificateData(array $devisOfDefunt, $logo = null, $signatureImageExist = false , $tamponImageExist = false)
|
||||
{
|
||||
$this->devisOfDefunt = $devisOfDefunt;
|
||||
$this->logo = $logo;
|
||||
$this->signatureImageExist = $signatureImageExist;
|
||||
$this->tamponImageExist = $tamponImageExist;
|
||||
}
|
||||
|
||||
public function SetPacemakerCertificate()
|
||||
@ -77,8 +79,12 @@ class PacemakerCertificatePdfHandler extends FPDF
|
||||
$this->SetXY(140, $this->GetY() + 15);
|
||||
$this->Cell(0, 10, 'Cachet et signature');
|
||||
|
||||
if ($this->signatureImageExist) {
|
||||
$this->Image($this->imagePath . "sign.png", 135, $this->GetY() + 12, 60, 40);
|
||||
if($this->tamponImageExist){
|
||||
$this->Image($this->imagePath."sign.jpg", 120, $this->GetY() + 8, 80, 35);
|
||||
}
|
||||
|
||||
if($this->signatureImageExist){
|
||||
$this->Image($this->imagePath."sign.png", 140, $this->GetY() + 40, 40, 16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user