mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Updates for design validation
This commit is contained in:
parent
04f9d1faf5
commit
21cc187326
@ -72,10 +72,8 @@ class PreviewController extends BaseController
|
||||
|
||||
public function show()
|
||||
{
|
||||
// if(request()->has('template')){
|
||||
if(request()->has('template'))
|
||||
return $this->template();
|
||||
// }
|
||||
nlog("wooops");
|
||||
|
||||
if (request()->has('entity') &&
|
||||
request()->has('entity_id') &&
|
||||
|
@ -40,10 +40,10 @@ class StoreDesignRequest extends Request
|
||||
//'name' => 'required',
|
||||
'name' => 'required|unique:designs,name,null,null,company_id,'.$user->companyId(),
|
||||
'design' => 'required|array',
|
||||
'design.header' => 'required|min:1',
|
||||
'design.body' => 'required|min:1',
|
||||
'design.footer' => 'required|min:1',
|
||||
'design.includes' => 'required|min:1',
|
||||
'design.header' => 'sometimes|string',
|
||||
'design.body' => 'sometimes|string',
|
||||
'design.footer' => 'sometimes|string',
|
||||
'design.includes' => 'sometimes|string',
|
||||
'is_template' => 'sometimes|boolean',
|
||||
'entities' => 'sometimes|string|nullable'
|
||||
];
|
||||
|
@ -222,14 +222,17 @@ class TemplateService
|
||||
|
||||
$processed = [];
|
||||
|
||||
if(in_array($key, ['tasks','projects']) || !$value->first() || !$value->first()->invitations()->first())
|
||||
return $processed;
|
||||
|
||||
match ($key) {
|
||||
'invoices' => $processed = (new HtmlEngine($value->first()->invitations()->first()))->generateLabelsAndValues(),
|
||||
'quotes' => $processed = (new HtmlEngine($value->first()->invitations()->first()))->generateLabelsAndValues(),
|
||||
'credits' => $processed = (new HtmlEngine($value->first()->invitations()->first()))->generateLabelsAndValues(),
|
||||
'payments' => $processed = (new PaymentHtmlEngine($value->first(), $value->first()->client->contacts()->first()))->generateLabelsAndValues(),
|
||||
'invoices' => $processed = (new HtmlEngine($value->first()->invitations()->first()))->generateLabelsAndValues() ?? [],
|
||||
'quotes' => $processed = (new HtmlEngine($value->first()->invitations()->first()))->generateLabelsAndValues() ?? [],
|
||||
'credits' => $processed = (new HtmlEngine($value->first()->invitations()->first()))->generateLabelsAndValues() ?? [],
|
||||
'payments' => $processed = (new PaymentHtmlEngine($value->first(), $value->first()->client->contacts()->first()))->generateLabelsAndValues() ?? [],
|
||||
'tasks' => $processed = [],
|
||||
'projects' => $processed = [],
|
||||
'purchase_orders' => $processed = $value->first() && $value->first()->invitations()->first() ? (new VendorHtmlEngine($value->first()->invitations()->first()))->generateLabelsAndValues() : [],
|
||||
'purchase_orders' => (new VendorHtmlEngine($value->first()->invitations()->first()))->generateLabelsAndValues() ?? [],
|
||||
};
|
||||
|
||||
return $processed;
|
||||
|
34
composer.lock
generated
34
composer.lock
generated
@ -485,16 +485,16 @@
|
||||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.281.12",
|
||||
"version": "3.281.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "22a92f08758db2b152843ea0875eeee5a467d8ff"
|
||||
"reference": "5547757d891495713aa7d5770bf04124d48a6ab5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/22a92f08758db2b152843ea0875eeee5a467d8ff",
|
||||
"reference": "22a92f08758db2b152843ea0875eeee5a467d8ff",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5547757d891495713aa7d5770bf04124d48a6ab5",
|
||||
"reference": "5547757d891495713aa7d5770bf04124d48a6ab5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -574,9 +574,9 @@
|
||||
"support": {
|
||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.281.12"
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.281.13"
|
||||
},
|
||||
"time": "2023-09-22T18:12:27+00:00"
|
||||
"time": "2023-09-25T18:07:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "bacon/bacon-qr-code",
|
||||
@ -2487,16 +2487,16 @@
|
||||
},
|
||||
{
|
||||
"name": "google/apiclient-services",
|
||||
"version": "v0.316.0",
|
||||
"version": "v0.317.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/googleapis/google-api-php-client-services.git",
|
||||
"reference": "08e3579d94363716cef2bc79643f3d30fdd914b5"
|
||||
"reference": "a11658da6e5ba713e3d636544895bb0af3c27689"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/08e3579d94363716cef2bc79643f3d30fdd914b5",
|
||||
"reference": "08e3579d94363716cef2bc79643f3d30fdd914b5",
|
||||
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/a11658da6e5ba713e3d636544895bb0af3c27689",
|
||||
"reference": "a11658da6e5ba713e3d636544895bb0af3c27689",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2525,9 +2525,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
|
||||
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.316.0"
|
||||
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.317.0"
|
||||
},
|
||||
"time": "2023-09-17T01:06:13+00:00"
|
||||
"time": "2023-09-24T01:06:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "google/auth",
|
||||
@ -6361,16 +6361,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
"version": "2.70.0",
|
||||
"version": "2.71.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/briannesbitt/Carbon.git",
|
||||
"reference": "d3298b38ea8612e5f77d38d1a99438e42f70341d"
|
||||
"reference": "98276233188583f2ff845a0f992a235472d9466a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d3298b38ea8612e5f77d38d1a99438e42f70341d",
|
||||
"reference": "d3298b38ea8612e5f77d38d1a99438e42f70341d",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/98276233188583f2ff845a0f992a235472d9466a",
|
||||
"reference": "98276233188583f2ff845a0f992a235472d9466a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -6463,7 +6463,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-09-07T16:43:50+00:00"
|
||||
"time": "2023-09-25T11:31:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nette/schema",
|
||||
|
Loading…
x
Reference in New Issue
Block a user