mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
c90604b5ae
|
@ -1,6 +1,10 @@
|
||||||
FROM ubuntu:bionic
|
FROM ubuntu:bionic
|
||||||
LABEL maintainer Brady Wetherington <uberbrady@gmail.com>
|
LABEL maintainer Brady Wetherington <uberbrady@gmail.com>
|
||||||
|
|
||||||
|
# No need to add `apt-get clean` here, reference:
|
||||||
|
# - https://github.com/snipe/snipe-it/pull/9201
|
||||||
|
# - https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get
|
||||||
|
|
||||||
RUN export DEBIAN_FRONTEND=noninteractive; \
|
RUN export DEBIAN_FRONTEND=noninteractive; \
|
||||||
export DEBCONF_NONINTERACTIVE_SEEN=true; \
|
export DEBCONF_NONINTERACTIVE_SEEN=true; \
|
||||||
echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
|
echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
|
||||||
|
@ -37,7 +41,6 @@ libmcrypt-dev \
|
||||||
php7.2-dev \
|
php7.2-dev \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
unzip \
|
unzip \
|
||||||
&& apt-get clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ use App\Models\Setting;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Intervention\Image\Facades\Image;
|
||||||
use DB;
|
use DB;
|
||||||
use Gate;
|
use Gate;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
@ -486,10 +487,16 @@ class AssetsController extends Controller
|
||||||
$barcode_width = ($settings->labels_width - $settings->labels_display_sgutter) * 96.000000000001;
|
$barcode_width = ($settings->labels_width - $settings->labels_display_sgutter) * 96.000000000001;
|
||||||
|
|
||||||
$barcode = new \Com\Tecnick\Barcode\Barcode();
|
$barcode = new \Com\Tecnick\Barcode\Barcode();
|
||||||
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode,$asset->asset_tag,($barcode_width < 300 ? $barcode_width : 300),50);
|
try {
|
||||||
|
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode,$asset->asset_tag,($barcode_width < 300 ? $barcode_width : 300),50);
|
||||||
|
file_put_contents($barcode_file, $barcode_obj->getPngData());
|
||||||
|
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
|
||||||
|
} catch(\Exception $e) {
|
||||||
|
\Log::debug('The barcode format is invalid.');
|
||||||
|
return response(file_get_contents(public_path('uploads/barcodes/invalid_barcode.gif')))->header('Content-type', 'image/gif');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
file_put_contents($barcode_file, $barcode_obj->getPngData());
|
|
||||||
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -441,6 +441,11 @@ Form::macro('alt_barcode_types', function ($name = "alt_barcode", $selected = nu
|
||||||
'C39',
|
'C39',
|
||||||
'PDF417',
|
'PDF417',
|
||||||
'EAN5',
|
'EAN5',
|
||||||
|
'EAN13',
|
||||||
|
'UPCA',
|
||||||
|
'UPCE',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue