minor fixes for self updater

This commit is contained in:
David Bomba 2022-05-25 20:53:12 +10:00
parent 51455cacef
commit a2977ef1ad
4 changed files with 18 additions and 6 deletions

View File

@ -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',

View File

@ -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");

View File

@ -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);
}

View File

@ -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;
}