From 9dfbeb2beb6bb499c4bc36f3a638061e507ab27a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 29 Oct 2023 11:09:00 +1100 Subject: [PATCH 1/5] Fixes for encoded entities in client portal --- app/Http/Livewire/PdfSlot.php | 2 +- .../views/portal/ninja2020/components/html-viewer.blade.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Livewire/PdfSlot.php b/app/Http/Livewire/PdfSlot.php index 91a51e588acd..1a12a4dc68bf 100644 --- a/app/Http/Livewire/PdfSlot.php +++ b/app/Http/Livewire/PdfSlot.php @@ -268,7 +268,7 @@ class PdfSlot extends Component 'line_total' => Number::formatMoney($item->line_total, $this->entity->client ?: $this->entity->vendor), ]; }); - + return $product_items; } diff --git a/resources/views/portal/ninja2020/components/html-viewer.blade.php b/resources/views/portal/ninja2020/components/html-viewer.blade.php index 2841d3a17487..f20885864a6a 100644 --- a/resources/views/portal/ninja2020/components/html-viewer.blade.php +++ b/resources/views/portal/ninja2020/components/html-viewer.blade.php @@ -156,7 +156,7 @@ span {
- {{ strip_tags($entity->public_notes) }} + {!! html_entity_decode($entity->public_notes) !!}
@@ -171,7 +171,7 @@ span {
- {{ strip_tags($entity->terms) }} + {!! html_entity_decode($entity->terms) !!}
@@ -186,7 +186,7 @@ span {
- {{ strip_tags($entity->footer) }} + {!! html_entity_decode($entity->footer) !!}
From a9188bf6e8fc9202ca796bb727f758a587be6384 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 30 Oct 2023 07:17:02 +1100 Subject: [PATCH 2/5] Remove build HTML --- app/Http/Controllers/BaseController.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index 2d5d41c24e3a..bab418747b5e 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -1179,8 +1179,6 @@ class BaseController extends Controller return 'main.next.dart.js'; case 'profile': return 'main.profile.dart.js'; - case 'html': - return 'main.html.dart.js'; default: return 'main.foss.dart.js'; } From 872ac11329957fe4280e78c494b8be071e2b90b9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 30 Oct 2023 08:07:47 +1100 Subject: [PATCH 3/5] Improvements for variable replacements --- app/Services/Pdf/PdfBuilder.php | 11 +++++++---- app/Utils/Helpers.php | 8 ++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/Services/Pdf/PdfBuilder.php b/app/Services/Pdf/PdfBuilder.php index d6df412c4213..c83e0fed78c4 100644 --- a/app/Services/Pdf/PdfBuilder.php +++ b/app/Services/Pdf/PdfBuilder.php @@ -1036,16 +1036,19 @@ class PdfBuilder */ public function getTableTotals() :array { + //need to see where we don't pass all these particular variables. try and refactor thisout - $_variables = array_key_exists('variables', $this->service->options) - ? $this->service->options['variables'] - : ['values' => ['$entity.public_notes' => $this->service->config->entity->public_notes, '$entity.terms' => $this->service->config->entity->terms, '$entity_footer' => $this->service->config->entity->footer], 'labels' => []]; + // $_variables = array_key_exists('variables', $this->service->options) + // ? $this->service->options['variables'] + // : ['values' => ['$entity.public_notes' => $this->service->config->entity->public_notes, '$entity.terms' => $this->service->config->entity->terms, '$entity_footer' => $this->service->config->entity->footer], 'labels' => []]; + + $_variables = $this->service->html_variables; $variables = $this->service->config->pdf_variables['total_columns']; $elements = [ ['element' => 'div', 'properties' => ['style' => 'display: flex; flex-direction: column;'], 'elements' => [ - ['element' => 'p', 'content' => strtr(str_replace(["labels","values"], ["",""], $_variables['values']['$entity.public_notes']), $_variables), 'properties' => ['data-ref' => 'total_table-public_notes', 'style' => 'text-align: left;']], + ['element' => 'p', 'content' => strtr(str_replace(["labels", "values"], ["",""], $_variables['values']['$entity.public_notes']), $_variables), 'properties' => ['data-ref' => 'total_table-public_notes', 'style' => 'text-align: left;']], ['element' => 'p', 'content' => '', 'properties' => ['style' => 'text-align: left; display: flex; flex-direction: column; page-break-inside: auto;'], 'elements' => [ ['element' => 'span', 'content' => '$entity.terms_label: ', 'properties' => ['hidden' => $this->entityVariableCheck('$entity.terms'), 'data-ref' => 'total_table-terms-label', 'style' => 'font-weight: bold; text-align: left; margin-top: 1rem;']], ['element' => 'span', 'content' => strtr(str_replace("labels", "", $_variables['values']['$entity.terms']), $_variables['labels']), 'properties' => ['data-ref' => 'total_table-terms', 'style' => 'text-align: left;']], diff --git a/app/Utils/Helpers.php b/app/Utils/Helpers.php index 0bbbca13d219..c7224eb0f19f 100644 --- a/app/Utils/Helpers.php +++ b/app/Utils/Helpers.php @@ -266,12 +266,12 @@ class Helpers $_right = ''; // If right side doesn't have any calculations, replace with raw ranges keyword. - if (! Str::contains($right, ['-', '+', '/', '*'])) { + if (! Str::contains(str_replace("year, $currentDateTime->month)->translatedFormat('F Y'); } // If right side contains one of math operations, calculate. - if (Str::contains($right, ['+'])) { + if (Str::contains(str_replace("keys()->first()), $replacements['literal'][$matches->keys()->first()], @@ -315,7 +315,7 @@ class Helpers ); } - if (Str::contains($match, ['-', '+', '/', '*'])) { + if (Str::contains(str_replace(" Date: Mon, 30 Oct 2023 08:08:59 +1100 Subject: [PATCH 4/5] Remove build HTML --- app/Utils/Helpers.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Utils/Helpers.php b/app/Utils/Helpers.php index c7224eb0f19f..029d79372bf9 100644 --- a/app/Utils/Helpers.php +++ b/app/Utils/Helpers.php @@ -18,6 +18,7 @@ use Carbon\Carbon; use Illuminate\Support\Str; use stdClass; +//30-10-2023: due to HTML encoding, need to remove Date: Mon, 30 Oct 2023 09:06:52 +1100 Subject: [PATCH 5/5] v5.7.37 --- VERSION.txt | 2 +- composer.lock | 36 ++++++++++++++++++------------------ config/ninja.php | 4 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 1d1a43ec8a07..794e21dd8eba 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.7.36 \ No newline at end of file +5.7.37 \ No newline at end of file diff --git a/composer.lock b/composer.lock index e1e0f74679ae..25ea94daad71 100644 --- a/composer.lock +++ b/composer.lock @@ -60,16 +60,16 @@ }, { "name": "apimatic/core", - "version": "0.3.2", + "version": "0.3.3", "source": { "type": "git", "url": "https://github.com/apimatic/core-lib-php.git", - "reference": "32238fb83ce9a3ebef38c726b497c0f218d6e6c9" + "reference": "984123c831598fc31749d194aa044cd46f227d29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/32238fb83ce9a3ebef38c726b497c0f218d6e6c9", - "reference": "32238fb83ce9a3ebef38c726b497c0f218d6e6c9", + "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/984123c831598fc31749d194aa044cd46f227d29", + "reference": "984123c831598fc31749d194aa044cd46f227d29", "shasum": "" }, "require": { @@ -107,9 +107,9 @@ ], "support": { "issues": "https://github.com/apimatic/core-lib-php/issues", - "source": "https://github.com/apimatic/core-lib-php/tree/0.3.2" + "source": "https://github.com/apimatic/core-lib-php/tree/0.3.3" }, - "time": "2023-07-11T09:30:32+00:00" + "time": "2023-10-26T06:52:40+00:00" }, { "name": "apimatic/core-interfaces", @@ -485,16 +485,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.283.11", + "version": "3.283.13", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "348b68edcc83062c329cf7540c4c92d061d27d9c" + "reference": "853eecfb21e8d623fa1b32e597b0a75912e8a404" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/348b68edcc83062c329cf7540c4c92d061d27d9c", - "reference": "348b68edcc83062c329cf7540c4c92d061d27d9c", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/853eecfb21e8d623fa1b32e597b0a75912e8a404", + "reference": "853eecfb21e8d623fa1b32e597b0a75912e8a404", "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.283.11" + "source": "https://github.com/aws/aws-sdk-php/tree/3.283.13" }, - "time": "2023-10-24T18:10:38+00:00" + "time": "2023-10-26T18:14:40+00:00" }, { "name": "bacon/bacon-qr-code", @@ -16363,16 +16363,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.4.1", + "version": "10.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "62bd7af13d282deeb95650077d28ba3600ca321c" + "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/62bd7af13d282deeb95650077d28ba3600ca321c", - "reference": "62bd7af13d282deeb95650077d28ba3600ca321c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", + "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", "shasum": "" }, "require": { @@ -16444,7 +16444,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.1" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.2" }, "funding": [ { @@ -16460,7 +16460,7 @@ "type": "tidelift" } ], - "time": "2023-10-08T05:01:11+00:00" + "time": "2023-10-26T07:21:45+00:00" }, { "name": "sebastian/cli-parser", diff --git a/config/ninja.php b/config/ninja.php index 6f9fdab3d065..6d1c3534d3d3 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -15,8 +15,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION','5.7.36'), - 'app_tag' => env('APP_TAG','5.7.36'), + 'app_version' => env('APP_VERSION','5.7.37'), + 'app_tag' => env('APP_TAG','5.7.37'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),