From 9b88f650d26afab97d052bebde32a61d897a4959 Mon Sep 17 00:00:00 2001 From: Jens Maes Date: Fri, 25 Feb 2022 08:19:46 +0100 Subject: [PATCH] Prevents showing double values - If the asset name and tag are the same, the tag does not get shown in an email. - If the model name is the same as the model number (when importing from LanSweeper for example), do not show the model number. --- .../views/notifications/markdown/checkin-asset.blade.php | 4 +++- .../views/notifications/markdown/checkout-asset.blade.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/views/notifications/markdown/checkin-asset.blade.php b/resources/views/notifications/markdown/checkin-asset.blade.php index 01ab12f32c..22f97799ce 100644 --- a/resources/views/notifications/markdown/checkin-asset.blade.php +++ b/resources/views/notifications/markdown/checkin-asset.blade.php @@ -13,14 +13,16 @@ @if ((isset($item->name)) && ($item->name!='')) | **{{ trans('mail.asset_name') }}** | {{ $item->name }} | @endif +@if (($item->name!=$item->asset_tag)) | **{{ trans('mail.asset_tag') }}** | {{ $item->asset_tag }} | +@endif @if (isset($item->manufacturer)) | **{{ trans('general.manufacturer') }}** | {{ $item->manufacturer->name }} | @endif @if (isset($item->model)) | **{{ trans('general.asset_model') }}** | {{ $item->model->name }} | @endif -@if (isset($item->model->model_number)) +@if ((isset($item->model->model_number)) && ($item->model->name!=$item->model->model_number)) | **{{ trans('general.model_no') }}** | {{ $item->model->model_number }} | @endif @if (isset($item->serial)) diff --git a/resources/views/notifications/markdown/checkout-asset.blade.php b/resources/views/notifications/markdown/checkout-asset.blade.php index 8e6297897d..4646cef482 100644 --- a/resources/views/notifications/markdown/checkout-asset.blade.php +++ b/resources/views/notifications/markdown/checkout-asset.blade.php @@ -13,14 +13,16 @@ @if ((isset($item->name)) && ($item->name!='')) | **{{ trans('mail.asset_name') }}** | {{ $item->name }} | @endif +@if (($item->name!=$item->asset_tag)) | **{{ trans('mail.asset_tag') }}** | {{ $item->asset_tag }} | +@endif @if (isset($item->manufacturer)) | **{{ trans('general.manufacturer') }}** | {{ $item->manufacturer->name }} | @endif @if (isset($item->model)) | **{{ trans('general.asset_model') }}** | {{ $item->model->name }} | @endif -@if (isset($item->model->model_number)) +@if ((isset($item->model->model_number)) && ($item->model->name!=$item->model->model_number)) | **{{ trans('general.model_no') }}** | {{ $item->model->model_number }} | @endif @if (isset($item->serial))