mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
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
This commit is contained in:
parent
980dccf31c
commit
98b20fc1cd
|
@ -803,6 +803,12 @@ class SettingsController extends Controller
|
||||||
$setting->labels_display_serial = 0;
|
$setting->labels_display_serial = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Input::has('labels_display_tag')) {
|
||||||
|
$setting->labels_display_tag = 1;
|
||||||
|
} else {
|
||||||
|
$setting->labels_display_tag = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (Input::has('labels_display_tag')) {
|
if (Input::has('labels_display_tag')) {
|
||||||
$setting->labels_display_tag = 1;
|
$setting->labels_display_tag = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class LabelsDisplayCompanyName extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('settings', function (Blueprint $table) {
|
||||||
|
$table->boolean('labels_display_model')->default(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('settings', function ($table) {
|
||||||
|
$table->dropColumn(
|
||||||
|
'labels_display_model'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,7 +11,7 @@
|
||||||
$settings->labels_width = $settings->labels_width - $settings->labels_display_sgutter;
|
$settings->labels_width = $settings->labels_width - $settings->labels_display_sgutter;
|
||||||
$settings->labels_height = $settings->labels_height - $settings->labels_display_bgutter;
|
$settings->labels_height = $settings->labels_height - $settings->labels_display_bgutter;
|
||||||
// Leave space on bottom for 1D barcode if necessary
|
// 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
|
// 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);
|
$qr_txt_size = ($settings->qr_code=='1' ? $settings->labels_width - $qr_size - .1: $settings->labels_width);
|
||||||
?>
|
?>
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
.qr_text {
|
.qr_text {
|
||||||
width: {{ $qr_txt_size }}in;
|
width: {{ $qr_txt_size }}in;
|
||||||
height: {{ $qr_size }}in;
|
height: {{ $qr_size }}in;
|
||||||
padding-top: .01in;
|
padding-top: .10in;
|
||||||
font-family: arial, helvetica, sans-serif;
|
font-family: arial, helvetica, sans-serif;
|
||||||
padding-right: .01in;
|
padding-right: .01in;
|
||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
|
@ -76,6 +76,12 @@
|
||||||
height: 50px;
|
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 {
|
@media print {
|
||||||
.noprint {
|
.noprint {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
|
@ -104,7 +110,7 @@
|
||||||
|
|
||||||
@foreach ($assets as $asset)
|
@foreach ($assets as $asset)
|
||||||
<?php $count++; ?>
|
<?php $count++; ?>
|
||||||
<div class="label"{!! ($count % $settings->labels_per_page == 0) ? ' style="margin-bottom: 0px;"' : '' !!}>
|
<div class="label">
|
||||||
|
|
||||||
@if ($settings->qr_code=='1')
|
@if ($settings->qr_code=='1')
|
||||||
<div class="qr_img">
|
<div class="qr_img">
|
||||||
|
@ -139,6 +145,12 @@
|
||||||
S: {{ $asset->serial }}
|
S: {{ $asset->serial }}
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
@if (($settings->labels_display_model=='1') && ($asset->model->name!=''))
|
||||||
|
<div class="pull-left">
|
||||||
|
M: {{ $asset->model->name }} {{ $asset->model->model_number }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if ((($settings->alt_barcode_enabled=='1') && $settings->alt_barcode!=''))
|
@if ((($settings->alt_barcode_enabled=='1') && $settings->alt_barcode!=''))
|
||||||
|
|
|
@ -179,10 +179,15 @@
|
||||||
{{ Form::checkbox('labels_display_tag', '1', Input::old('labels_display_tag', $setting->labels_display_tag),['class' => 'minimal']) }}
|
{{ Form::checkbox('labels_display_tag', '1', Input::old('labels_display_tag', $setting->labels_display_tag),['class' => 'minimal']) }}
|
||||||
{{ trans('admin/hardware/form.tag') }}
|
{{ trans('admin/hardware/form.tag') }}
|
||||||
</label>
|
</label>
|
||||||
|
<label>
|
||||||
|
{{ Form::checkbox('labels_display_model', '1', Input::old('labels_display_model', $setting->labels_display_model),['class' => 'minimal']) }}
|
||||||
|
{{ trans('admin/hardware/form.model') }}
|
||||||
|
</label>
|
||||||
<label>
|
<label>
|
||||||
{{ Form::checkbox('labels_display_company_name', '1', Input::old('labels_display_company_name', $setting->labels_display_company_name),['class' => 'minimal']) }}
|
{{ Form::checkbox('labels_display_company_name', '1', Input::old('labels_display_company_name', $setting->labels_display_company_name),['class' => 'minimal']) }}
|
||||||
{{ trans('admin/companies/table.name') }}
|
{{ trans('admin/companies/table.name') }}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</div> <!--/.CHECKBOX-->
|
</div> <!--/.CHECKBOX-->
|
||||||
</div> <!--/.col-md-9-->
|
</div> <!--/.col-md-9-->
|
||||||
</div> <!--/.form-group-->
|
</div> <!--/.form-group-->
|
||||||
|
|
Loading…
Reference in a new issue