From deff312381337dad07b2622e63d41eb772977e36 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 26 Apr 2023 18:16:23 -0700 Subject: [PATCH 1/4] Remove auto-link from from manufacturer warranty Signed-off-by: snipe --- app/Presenters/ManufacturerPresenter.php | 4 ++-- resources/views/partials/bootstrap-table.blade.php | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Presenters/ManufacturerPresenter.php b/app/Presenters/ManufacturerPresenter.php index bc1f08c0d2..ed1802cf3b 100644 --- a/app/Presenters/ManufacturerPresenter.php +++ b/app/Presenters/ManufacturerPresenter.php @@ -56,7 +56,7 @@ class ManufacturerPresenter extends Presenter 'switchable' => true, 'title' => trans('admin/manufacturers/table.support_url'), 'visible' => true, - 'formatter' => 'linkFormatter', + 'formatter' => 'externalLinkFormatter', ], [ @@ -85,7 +85,7 @@ class ManufacturerPresenter extends Presenter 'switchable' => true, 'title' => trans('admin/manufacturers/table.warranty_lookup_url'), 'visible' => false, - 'formatter' => 'linkFormatter', + 'formatter' => 'externalLinkFormatter', ], [ diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 3e6a9ea3b0..2639a8a801 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -511,8 +511,12 @@ } function externalLinkFormatter(value) { + if (value) { - return '' + value + ''; + if ((value.indexOf("{") === -1) || (value.indexOf("}") ===-1)) { + return '' + value + ' {{ trans('hardware/general.mfg_warranty_lookup') }}'; + } + return value; } } From e853f8b7fdb7aeede572ede6a625704d0b138043 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 26 Apr 2023 18:23:21 -0700 Subject: [PATCH 2/4] Removed SR text for exporting Signed-off-by: snipe --- resources/views/partials/bootstrap-table.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 2639a8a801..1b12567396 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -514,7 +514,7 @@ if (value) { if ((value.indexOf("{") === -1) || (value.indexOf("}") ===-1)) { - return '' + value + ' {{ trans('hardware/general.mfg_warranty_lookup') }}'; + return '' + value + ' '; } return value; } From 99ef435d40b424c03a74f483eac1f1fa126dd3aa Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 26 Apr 2023 18:32:38 -0700 Subject: [PATCH 3/4] Fixed translation Signed-off-by: snipe --- resources/views/hardware/view.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index e29c9da3af..44d63c2b49 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -597,7 +597,7 @@ @if (($asset->model->manufacturer) && ($asset->model->manufacturer->warranty_lookup_url!='')) - {{ trans('hardware/general.mfg_warranty_lookup') }} + {{ trans('admin/hardware/general.mfg_warranty_lookup', ['manufacturer' => $asset->model->manufacturer->name]) }} @endif From e25dc42121736e401118dafffeab895c947fe876 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 26 Apr 2023 18:42:34 -0700 Subject: [PATCH 4/4] Switch to externalLinkFormatter Signed-off-by: snipe --- app/Presenters/ManufacturerPresenter.php | 2 +- resources/views/partials/bootstrap-table.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Presenters/ManufacturerPresenter.php b/app/Presenters/ManufacturerPresenter.php index ed1802cf3b..f5c15f1fe5 100644 --- a/app/Presenters/ManufacturerPresenter.php +++ b/app/Presenters/ManufacturerPresenter.php @@ -47,7 +47,7 @@ class ManufacturerPresenter extends Presenter 'switchable' => true, 'title' => trans('admin/manufacturers/table.url'), 'visible' => true, - 'formatter' => 'linkFormatter', + 'formatter' => 'externalLinkFormatter', ], [ 'field' => 'support_url', diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 1b12567396..3f263dd96e 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -514,7 +514,7 @@ if (value) { if ((value.indexOf("{") === -1) || (value.indexOf("}") ===-1)) { - return '' + value + ' '; + return ' ' + value + ''; } return value; }