mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on client portal
This commit is contained in:
parent
97ce699879
commit
203e651b48
@ -50,15 +50,17 @@ class PdfSlot extends Component
|
|||||||
{
|
{
|
||||||
|
|
||||||
$this->pdf = $this->entity->fullscreenPdfViewer($this->invitation);
|
$this->pdf = $this->entity->fullscreenPdfViewer($this->invitation);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHtml()
|
||||||
|
{
|
||||||
|
|
||||||
$pdf_service = new PdfService($this->invitation);
|
$pdf_service = new PdfService($this->invitation);
|
||||||
|
|
||||||
|
|
||||||
// $company_details = $pdf_service->config->settings->pdf_variables->company_details;
|
|
||||||
|
|
||||||
|
|
||||||
$pdf_service->config = (new PdfConfiguration($pdf_service))->init();
|
$pdf_service->config = (new PdfConfiguration($pdf_service))->init();
|
||||||
|
|
||||||
|
|
||||||
$pdf_service->html_variables = $pdf_service->config->client ?
|
$pdf_service->html_variables = $pdf_service->config->client ?
|
||||||
(new HtmlEngine($this->invitation))->generateLabelsAndValues() :
|
(new HtmlEngine($this->invitation))->generateLabelsAndValues() :
|
||||||
(new VendorHtmlEngine($this->invitation))->generateLabelsAndValues();
|
(new VendorHtmlEngine($this->invitation))->generateLabelsAndValues();
|
||||||
@ -68,55 +70,34 @@ class PdfSlot extends Component
|
|||||||
|
|
||||||
$pdf_service->builder = (new PdfBuilder($pdf_service));
|
$pdf_service->builder = (new PdfBuilder($pdf_service));
|
||||||
|
|
||||||
$section = [
|
$section = [
|
||||||
'company-details' => [
|
'company-details' => [
|
||||||
'id' => 'company-details',
|
'id' => 'company-details',
|
||||||
'elements' => $pdf_service->builder->companyDetails(),
|
'elements' => $pdf_service->builder->companyDetails(),
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$document = new \DOMDocument();
|
||||||
|
$document->validateOnParse = true;
|
||||||
|
@$document->loadHTML(mb_convert_encoding($pdf_service->designer->template, 'HTML-ENTITIES', 'UTF-8'));
|
||||||
|
|
||||||
|
$pdf_service->builder->document = $document;
|
||||||
|
|
||||||
$document = new \DOMDocument();
|
$pdf_service->builder->sections = $section;
|
||||||
$document->validateOnParse = true;
|
|
||||||
@$document->loadHTML(mb_convert_encoding($pdf_service->designer->template, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
|
||||||
$pdf_service->builder->document = $document;
|
|
||||||
|
|
||||||
$pdf_service->builder->sections = $section;
|
$html = $pdf_service->builder
|
||||||
|
|
||||||
$html = $pdf_service->builder
|
|
||||||
->getEmptyElements()
|
->getEmptyElements()
|
||||||
->updateElementProperties()
|
->updateElementProperties()
|
||||||
->updateVariables();
|
->updateVariables()
|
||||||
|
->getCompiledHTML();
|
||||||
|
|
||||||
nlog($html->getCompiledHTML());
|
$doc = new \DOMDocument();
|
||||||
|
|
||||||
|
$doc->loadHTML($html);
|
||||||
|
$doc->removeChild($doc->doctype);
|
||||||
|
$doc->replaceChild($doc->firstChild->firstChild->firstChild, $doc->firstChild);
|
||||||
|
|
||||||
|
nlog($doc->saveHTML());
|
||||||
|
|
||||||
// nlog($section);
|
|
||||||
|
|
||||||
// $document = new \DOMDocument();
|
|
||||||
// @$document->loadHTML(mb_convert_encoding('<div></div>', 'HTML-ENTITIES', 'UTF-8'));
|
|
||||||
// $pdf_service->designer->template = '';
|
|
||||||
// $pdf_service->builder->document = $document;
|
|
||||||
|
|
||||||
// $pdf_service->builder
|
|
||||||
// ->sections = $section;
|
|
||||||
|
|
||||||
// nlog($pdf_service->builder->sections);
|
|
||||||
|
|
||||||
// $html = $pdf_service->builder
|
|
||||||
// ->getEmptyElements()
|
|
||||||
// ->updateElementProperties()
|
|
||||||
// ->updateVariables();
|
|
||||||
|
|
||||||
// nlog($html->getCompiledHTML());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getHtml()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user