From 98b20fc1cd502a81af644dfb935fd8ee23e874e0 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 12 Jul 2018 18:23:12 -0700 Subject: [PATCH] Added option to include model information on asset labels. (#5301) * Added option to include model information on asset labels. Cleaned up label page to fix skewed label alignment on last row per page. * Changes made per Snipe's direction changed type from tinyint to boolean in DB changed labels back to initials --- app/Http/Controllers/SettingsController.php | 8 ++++- ...018_04_02_150700__labels_display_model.php | 34 +++++++++++++++++++ resources/views/hardware/labels.blade.php | 22 +++++++++--- resources/views/settings/labels.blade.php | 9 +++-- 4 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 database/migrations/2018_04_02_150700__labels_display_model.php diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 931addf24e..69d6c71061 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -807,7 +807,13 @@ class SettingsController extends Controller $setting->labels_display_tag = 1; } else { $setting->labels_display_tag = 0; - } + } + + if (Input::has('labels_display_tag')) { + $setting->labels_display_tag = 1; + } else { + $setting->labels_display_tag = 0; + } if ($setting->save()) { return redirect()->route('settings.index') diff --git a/database/migrations/2018_04_02_150700__labels_display_model.php b/database/migrations/2018_04_02_150700__labels_display_model.php new file mode 100644 index 0000000000..8b8326cb03 --- /dev/null +++ b/database/migrations/2018_04_02_150700__labels_display_model.php @@ -0,0 +1,34 @@ +boolean('labels_display_model')->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('settings', function ($table) { + $table->dropColumn( + 'labels_display_model' + ); + }); + } +} diff --git a/resources/views/hardware/labels.blade.php b/resources/views/hardware/labels.blade.php index 8ed4fbc50f..b0a83031c5 100644 --- a/resources/views/hardware/labels.blade.php +++ b/resources/views/hardware/labels.blade.php @@ -11,7 +11,7 @@ $settings->labels_width = $settings->labels_width - $settings->labels_display_sgutter; $settings->labels_height = $settings->labels_height - $settings->labels_display_bgutter; // Leave space on bottom for 1D barcode if necessary - $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->alt_barcode!='') ? $settings->labels_height - .25 : $settings->labels_height; + $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->alt_barcode!='') ? $settings->labels_height - .3 : $settings->labels_height - .3; // Leave space on left for QR code if necessary $qr_txt_size = ($settings->qr_code=='1' ? $settings->labels_width - $qr_size - .1: $settings->labels_width); ?> @@ -60,7 +60,7 @@ .qr_text { width: {{ $qr_txt_size }}in; height: {{ $qr_size }}in; - padding-top: .01in; + padding-top: .10in; font-family: arial, helvetica, sans-serif; padding-right: .01in; overflow: hidden !important; @@ -75,6 +75,12 @@ display: inline; height: 50px; } + + .next-padding { + margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in; + } + + @media print { .noprint { @@ -104,7 +110,7 @@ @foreach ($assets as $asset) -
labels_per_page == 0) ? ' style="margin-bottom: 0px;"' : '' !!}> +
@if ($settings->qr_code=='1')
@@ -130,7 +136,7 @@
@endif @if (($settings->labels_display_tag=='1') && ($asset->asset_tag!='')) -
+
T: {{ $asset->asset_tag }}
@endif @@ -138,7 +144,13 @@
S: {{ $asset->serial }}
- @endif + @endif + @if (($settings->labels_display_model=='1') && ($asset->model->name!='')) +
+ M: {{ $asset->model->name }} {{ $asset->model->model_number }} +
+ @endif +
@if ((($settings->alt_barcode_enabled=='1') && $settings->alt_barcode!='')) diff --git a/resources/views/settings/labels.blade.php b/resources/views/settings/labels.blade.php index e3409c4c11..b5aa103f5c 100644 --- a/resources/views/settings/labels.blade.php +++ b/resources/views/settings/labels.blade.php @@ -163,7 +163,7 @@
- {{ Form::label('labels_width', trans('admin/settings/general.label_fields')) }} + {{ Form::label('labels_width', trans('admin/settings/general.label_fields')) }}
@@ -178,11 +178,16 @@ + + +