/** * Get the QR code representing the asset * * @param int $assetId * @return View **/ public function getQrCode($assetId = null) { $settings = Setting::getSettings(); if ($settings->qr_code == '1') { $asset = Asset::find($assetId); $size = barcodeDimensions($settings->barcode_type); if (!Company::isCurrentUserHasAccess($asset)) { return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions')); } if (isset($asset->id, $asset->asset_tag)) { $barcode = new \Com\Tecnick\Barcode\Barcode(); $barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('view/hardware', $asset->id), $size['height'], $size['width'], 'black', array(-2, -2, -2, -2)); return $barcode_obj->getPngData(); } } }
/** * Get the QR code representing the asset * * @param int $assetId * @return View **/ public function getQrCode($assetId = null) { $settings = Setting::getSettings(); if ($settings->qr_code == '1') { $asset = Asset::find($assetId); $size = barcodeDimensions($settings->barcode_type); if (isset($asset->id, $asset->asset_tag)) { $barcode = new \Com\Tecnick\Barcode\Barcode(); $barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('view/hardware', $asset->id), $size['height'], $size['width'], 'black', array(-2, -2, -2, -2)); return $barcode_obj->getPngData(); } } }