diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index b253b9397f99..a3d272a5c410 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -277,6 +277,7 @@ class CompanySettings extends BaseSettings public $auto_archive_invoice_cancelled = false; public static $casts = [ + 'page_numbering_alignment' => 'string', 'page_numbering' => 'bool', 'auto_archive_invoice_cancelled' => 'bool', 'email_from_name' => 'string', diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index 6c53ead3b902..c220c1f0400a 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -134,13 +134,21 @@ class SelfUpdateController extends BaseController nlog("Extracting zip"); - $zipFile = new \PhpZip\ZipFile(); + // $zipFile = new \PhpZip\ZipFile(); - $zipFile->openFile($file); + // $zipFile->openFile($file); - $zipFile->extractTo(base_path()); + // $zipFile->extractTo(base_path()); - $zipFile->close(); + // $zipFile->close(); + + $zip = new \ZipArchive; + + $res = $zip->open($file); + if ($res === TRUE) { + $zip->extractTo(base_path()); + $zip->close(); + } nlog("Finished extracting files"); diff --git a/app/Jobs/Entity/CreateEntityPdf.php b/app/Jobs/Entity/CreateEntityPdf.php index 54bba3c058b7..2383ee735ec5 100644 --- a/app/Jobs/Entity/CreateEntityPdf.php +++ b/app/Jobs/Entity/CreateEntityPdf.php @@ -190,6 +190,7 @@ class CreateEntityPdf implements ShouldQueue if(config('ninja.invoiceninja_hosted_pdf_generation') || config('ninja.pdf_generator') == 'hosted_ninja'){ $pdf = (new NinjaPdf())->build($maker->getCompiledHTML(true)); + $pdf = $this->pageNumbering($pdf, $this->company); } diff --git a/app/Utils/Traits/Pdf/PDF.php b/app/Utils/Traits/Pdf/PDF.php index 3e966b2c440d..56bfbff87e0d 100644 --- a/app/Utils/Traits/Pdf/PDF.php +++ b/app/Utils/Traits/Pdf/PDF.php @@ -23,7 +23,8 @@ class PDF extends FPDI $this->SetXY(0, -5); - $this->SetFont('Arial','I',9); + $this->SetFont('Arial','I', 9); + $this->SetTextColor(135,135,135); $trans = ctrans('texts.pdf_page_info', ['current' => $this->PageNo(), 'total' => '{nb}']); @@ -33,7 +34,8 @@ class PDF extends FPDI public function setAlignment($alignment) { - $this->text_alignment = $alignment; + if(in_array($alignment, ['C','L','R'])) + $this->text_alignment = $alignment; return $this; }