1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Update templates with new check for entity variables

This commit is contained in:
Benjamin Beganović 2020-08-14 14:54:06 +02:00
parent da3a86381e
commit f42c76d8a8
10 changed files with 12 additions and 55 deletions

View File

@ -130,7 +130,7 @@ class Bold extends BaseDesign
$elements = [];
foreach ($variables as $variable) {
$elements[] = ['element' => 'tr', 'content' => '', 'elements' => [
$elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'content' => '', 'elements' => [
['element' => 'th', 'content' => $variable . '_label', 'properties' => ['class' => 'text-left pr-4 font-normal']],
['element' => 'th', 'content' => $variable, 'properties' => ['class' => 'text-left pr-4 font-normal']],
]];

View File

@ -130,7 +130,7 @@ class Business extends BaseDesign
$elements = [];
foreach ($variables as $variable) {
$elements[] = ['element' => 'tr', 'content' => '', 'elements' => [
$elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'content' => '', 'elements' => [
['element' => 'th', 'content' => $variable . '_label', 'properties' => ['class' => 'text-left pr-4 font-normal']],
['element' => 'th', 'content' => $variable, 'properties' => ['class' => 'text-left pr-4 font-normal']],
]];

View File

@ -117,7 +117,7 @@ class Clean extends BaseDesign
$elements = [];
foreach ($variables as $variable) {
$elements[] = ['element' => 'tr', 'content' => '', 'elements' => [
$elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'content' => '', 'elements' => [
['element' => 'th', 'content' => $variable . '_label', 'properties' => ['class' => 'text-left pr-4 font-normal']],
['element' => 'th', 'content' => $variable, 'properties' => ['class' => 'text-left pr-4 font-normal']],
]];

View File

@ -130,7 +130,7 @@ class Creative extends BaseDesign
$elements = [];
foreach ($variables as $variable) {
$elements[] = ['element' => 'tr', 'content' => '', 'elements' => [
$elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'content' => '', 'elements' => [
['element' => 'th', 'content' => $variable . '_label', 'properties' => ['class' => 'text-left pr-4 font-normal']],
['element' => 'th', 'content' => $variable, 'properties' => ['class' => 'text-left pr-4 font-normal']],
]];

View File

@ -91,7 +91,7 @@ class Elegant extends BaseDesign
$elements = [];
foreach ($variables as $variable) {
$elements[] = ['element' => 'tr', 'content' => '', 'elements' => [
$elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'content' => '', 'elements' => [
['element' => 'th', 'content' => $variable . '_label', 'properties' => ['class' => 'text-left pr-4 font-normal']],
['element' => 'th', 'content' => $variable, 'properties' => ['class' => 'text-left pr-4 font-normal']],
]];

View File

@ -130,7 +130,7 @@ class Hipster extends BaseDesign
$elements = [];
foreach ($variables as $variable) {
$elements[] = ['element' => 'div', 'properties' => ['class' => 'space-x-4'], 'content' => '', 'elements' => [
$elements[] = ['element' => 'div', 'properties' => ['hidden' => $this->entityVariableCheck($variable), 'class' => 'space-x-4'], 'content' => '', 'elements' => [
['element' => 'span', 'content' => $variable . '_label', 'properties' => ['class' => 'font-semibold uppercase text-yellow-600']],
['element' => 'span', 'content' => $variable, 'properties' => ['class' => 'uppercase']],
]];

View File

@ -91,7 +91,7 @@ class Modern extends BaseDesign
$elements = [];
foreach ($variables as $variable) {
$elements[] = ['element' => 'tr', 'content' => '', 'elements' => [
$elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'content' => '', 'elements' => [
['element' => 'th', 'content' => $variable . '_label', 'properties' => ['class' => 'text-left pr-16 lg:pr-24 font-normal']],
['element' => 'th', 'content' => $variable, 'properties' => ['class' => 'text-left pr-16 lg:pr-24 font-normal']],
]];

View File

@ -1,45 +0,0 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Services\PdfMaker\Designs;
use App\Services\PdfMaker\Designs\Utilities\BaseDesign;
use App\Services\PdfMaker\Designs\Utilities\DesignHelpers;
use App\Utils\Traits\MakesInvoiceValues;
/** @deprecated */
class Photo extends BaseDesign
{
use MakesInvoiceValues, DesignHelpers;
/** Global list of table elements, @var array */
public $elements;
/** @var App\Models\Client */
public $client;
/** @var App\Models\Invoice || @var App\Models\Quote */
public $entity;
/** Global state of the design, @var array */
public $context;
/** Type of entity => product||task */
public $type;
public function html()
{
return file_get_contents(
base_path('resources/views/pdf-designs/bold.html')
);
}
}

View File

@ -100,10 +100,12 @@ class Plain extends BaseDesign
$elements = [];
foreach ($variables as $variable) {
$elements[] = ['element' => 'tr', 'content' => '', 'elements' => [
$element = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'content' => '', 'elements' => [
['element' => 'th', 'content' => $variable . '_label', 'properties' => ['class' => 'text-left pr-4 font-normal']],
['element' => 'th', 'content' => $variable, 'properties' => ['class' => 'text-left pr-4 font-medium']],
]];
$elements[] = $element;
}
return $elements;

View File

@ -91,7 +91,7 @@ class Playful extends BaseDesign
$elements = [];
foreach ($variables as $variable) {
$elements[] = ['element' => 'tr', 'content' => '', 'elements' => [
$elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'content' => '', 'elements' => [
['element' => 'th', 'content' => $variable . '_label', 'properties' => ['class' => 'text-left pr-4 font-normal']],
['element' => 'th', 'content' => $variable, 'properties' => ['class' => 'text-left pr-4 font-medium']],
]];