1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Update DesignUpdate with new namespace

This commit is contained in:
Benjamin Beganović 2020-08-11 18:36:56 +02:00
parent 1d7e4fd6c9
commit 5ebe60c78e
2 changed files with 53 additions and 7 deletions

View File

@ -39,16 +39,17 @@ class DesignUpdate extends Command
public function handle()
{
foreach (Design::whereIsCustom(false)->get() as $design) {
$class = 'App\Designs\\'.$design->name;
$class = 'App\Services\PdfMaker\Designs\\'.$design->name;
$invoice_design = new $class();
$invoice_design->document();
$design_object = new \stdClass;
$design_object->includes = $invoice_design->includes() ?: '';
$design_object->header = $invoice_design->header() ?: '';
$design_object->body = $invoice_design->body() ?: '';
$design_object->product = $invoice_design->product() ?: '';
$design_object->task = $invoice_design->task() ?: '';
$design_object->footer = $invoice_design->footer() ?: '';
$design_object->includes = $invoice_design->getSectionHTML('includes');
$design_object->header = $invoice_design->getSectionHTML('head', false);
$design_object->body = $invoice_design->getSectionHTML('body', false);
$design_object->product = $invoice_design->getSectionHTML('product-table');
$design_object->task = $invoice_design->getSectionHTML('task-table');
$design_object->footer = $invoice_design->getSectionHTML('footer', false);
$design->design = $design_object;
$design->save();

View File

@ -0,0 +1,45 @@
<?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')
);
}
}