Merge branch 'develop' into snipeit_v7_laravel10

This commit is contained in:
Brady Wetherington 2023-08-15 21:25:16 +01:00
commit 8b52bad16f
649 changed files with 9075 additions and 7584 deletions

View file

@ -2952,6 +2952,15 @@
"contributions": [
"code"
]
},
{
"login": "cram42",
"name": "Grant Le Roux",
"avatar_url": "https://avatars.githubusercontent.com/u/5396871?v=4",
"profile": "https://github.com/cram42",
"contributions": [
"code"
]
}
]
}

View file

@ -20,10 +20,8 @@ on:
pipeline:
- name: Setup
cmd: |
cp -v .env.example .env
# This is simply to allow passing the guard in TestCase@setUp()
# https://chipperci.com/docs/builds/env
touch .env.testing
cp -v .env.testing.example .env
cp -v .env.testing.example .env.testing
composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Generate Key
@ -36,15 +34,15 @@ pipeline:
- name: Run Migrations
cmd: |
# php artisan migrate --force
php artisan migrate --force
- name: PHPUnit Unit Tests
cmd: |
# php artisan test --testsuite Unit
php artisan test --testsuite Unit
- name: PHPUnit Feature Tests
cmd: |
# php artisan test --testsuite Feature
php artisan test --testsuite Feature
# - name: Browser Tests
# cmd: |

View file

@ -149,6 +149,7 @@ AWS_DEFAULT_REGION=null
# --------------------------------------------
LOGIN_MAX_ATTEMPTS=5
LOGIN_LOCKOUT_DURATION=60
LOGIN_AUTOCOMPLETE=false
# --------------------------------------------
# OPTIONAL: FORGOTTEN PASSWORD SETTINGS

View file

@ -1,5 +1,5 @@
![Build Status](https://app.chipperci.com/projects/0e5f8979-31eb-4ee6-9abf-050b76ab0383/status/master) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.svg)](https://crowdin.com/project/snipe-it) [![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/) [![Twitter Follow](https://img.shields.io/twitter/follow/snipeitapp.svg?style=social)](https://twitter.com/snipeitapp) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/553ce52037fc43ea99149785afcfe641)](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&utm_medium=referral&utm_content=snipe/snipe-it&utm_campaign=Badge_Grade)
[![All Contributors](https://img.shields.io/badge/all_contributors-325-orange.svg?style=flat-square)](#contributors) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/yZFtShAcKk) [![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev)
[![All Contributors](https://img.shields.io/badge/all_contributors-326-orange.svg?style=flat-square)](#contributors) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/yZFtShAcKk) [![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev)
## Snipe-IT - Open Source Asset Management System
@ -145,7 +145,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
| [<img src="https://avatars.githubusercontent.com/u/28321?v=4" width="110px;"/><br /><sub>Chris Hartjes</sub>](http://www.littlehart.net/atthekeyboard)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chartjes "Code") | [<img src="https://avatars.githubusercontent.com/u/2404584?v=4" width="110px;"/><br /><sub>geo-chen</sub>](https://github.com/geo-chen)<br />[💻](https://github.com/snipe/snipe-it/commits?author=geo-chen "Code") | [<img src="https://avatars.githubusercontent.com/u/6006620?v=4" width="110px;"/><br /><sub>Phan Nguyen</sub>](https://github.com/nh314)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nh314 "Code") | [<img src="https://avatars.githubusercontent.com/u/115993812?v=4" width="110px;"/><br /><sub>Iisakki Jaakkola</sub>](https://github.com/StarlessNights)<br />[💻](https://github.com/snipe/snipe-it/commits?author=StarlessNights "Code") | [<img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="110px;"/><br /><sub>Ikko Ashimine</sub>](https://bandism.net/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=eltociear "Code") | [<img src="https://avatars.githubusercontent.com/u/56871540?v=4" width="110px;"/><br /><sub>Lukas Fehling</sub>](https://github.com/lukasfehling)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lukasfehling "Code") | [<img src="https://avatars.githubusercontent.com/u/1975990?v=4" width="110px;"/><br /><sub>Fernando Almeida</sub>](https://github.com/fernando-almeida)<br />[💻](https://github.com/snipe/snipe-it/commits?author=fernando-almeida "Code") |
| [<img src="https://avatars.githubusercontent.com/u/116301219?v=4" width="110px;"/><br /><sub>akemidx</sub>](https://github.com/akemidx)<br />[💻](https://github.com/snipe/snipe-it/commits?author=akemidx "Code") | [<img src="https://avatars.githubusercontent.com/u/144778?v=4" width="110px;"/><br /><sub>Oguz Bilgic</sub>](http://oguz.site)<br />[💻](https://github.com/snipe/snipe-it/commits?author=oguzbilgic "Code") | [<img src="https://avatars.githubusercontent.com/u/9262438?v=4" width="110px;"/><br /><sub>Scooter Crawford</sub>](https://github.com/scoo73r)<br />[💻](https://github.com/snipe/snipe-it/commits?author=scoo73r "Code") | [<img src="https://avatars.githubusercontent.com/u/5957345?v=4" width="110px;"/><br /><sub>subdriven</sub>](https://github.com/subdriven)<br />[💻](https://github.com/snipe/snipe-it/commits?author=subdriven "Code") | [<img src="https://avatars.githubusercontent.com/u/658865?v=4" width="110px;"/><br /><sub>Andrew Savinykh</sub>](https://github.com/AndrewSav)<br />[💻](https://github.com/snipe/snipe-it/commits?author=AndrewSav "Code") | [<img src="https://avatars.githubusercontent.com/u/1155067?v=4" width="110px;"/><br /><sub>Tadayuki Onishi</sub>](https://kenchan0130.github.io)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kenchan0130 "Code") | [<img src="https://avatars.githubusercontent.com/u/112496896?v=4" width="110px;"/><br /><sub>Florian</sub>](https://github.com/floschoepfer)<br />[💻](https://github.com/snipe/snipe-it/commits?author=floschoepfer "Code") |
| [<img src="https://avatars.githubusercontent.com/u/7305753?v=4" width="110px;"/><br /><sub>Spencer Long</sub>](http://spencerlong.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=spencerrlongg "Code") | [<img src="https://avatars.githubusercontent.com/u/1141514?v=4" width="110px;"/><br /><sub>Marcus Moore</sub>](https://github.com/marcusmoore)<br />[💻](https://github.com/snipe/snipe-it/commits?author=marcusmoore "Code") | [<img src="https://avatars.githubusercontent.com/u/570639?v=4" width="110px;"/><br /><sub>Martin Meredith</sub>](https://github.com/Mezzle)<br /> | [<img src="https://avatars.githubusercontent.com/u/5731963?v=4" width="110px;"/><br /><sub>dboth</sub>](http://dboth.de)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dboth "Code") | [<img src="https://avatars.githubusercontent.com/u/87536651?v=4" width="110px;"/><br /><sub>Zachary Fleck</sub>](https://github.com/zacharyfleck)<br />[💻](https://github.com/snipe/snipe-it/commits?author=zacharyfleck "Code") | [<img src="https://avatars.githubusercontent.com/u/74609912?v=4" width="110px;"/><br /><sub>VIKAAS-A</sub>](https://github.com/vikaas-cyper)<br />[💻](https://github.com/snipe/snipe-it/commits?author=vikaas-cyper "Code") | [<img src="https://avatars.githubusercontent.com/u/88882041?v=4" width="110px;"/><br /><sub>Abdul Kareem</sub>](https://github.com/ak-piracha)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ak-piracha "Code") |
| [<img src="https://avatars.githubusercontent.com/u/111287779?v=4" width="110px;"/><br /><sub>NojoudAlshehri</sub>](https://github.com/NojoudAlshehri)<br />[💻](https://github.com/snipe/snipe-it/commits?author=NojoudAlshehri "Code") | [<img src="https://avatars.githubusercontent.com/u/54367449?v=4" width="110px;"/><br /><sub>Stefan Stidl</sub>](https://github.com/stefanstidlffg)<br />[💻](https://github.com/snipe/snipe-it/commits?author=stefanstidlffg "Code") | [<img src="https://avatars.githubusercontent.com/u/87803479?v=4" width="110px;"/><br /><sub>Quentin Aymard</sub>](https://github.com/qay21)<br />[💻](https://github.com/snipe/snipe-it/commits?author=qay21 "Code") |
| [<img src="https://avatars.githubusercontent.com/u/111287779?v=4" width="110px;"/><br /><sub>NojoudAlshehri</sub>](https://github.com/NojoudAlshehri)<br />[💻](https://github.com/snipe/snipe-it/commits?author=NojoudAlshehri "Code") | [<img src="https://avatars.githubusercontent.com/u/54367449?v=4" width="110px;"/><br /><sub>Stefan Stidl</sub>](https://github.com/stefanstidlffg)<br />[💻](https://github.com/snipe/snipe-it/commits?author=stefanstidlffg "Code") | [<img src="https://avatars.githubusercontent.com/u/87803479?v=4" width="110px;"/><br /><sub>Quentin Aymard</sub>](https://github.com/qay21)<br />[💻](https://github.com/snipe/snipe-it/commits?author=qay21 "Code") | [<img src="https://avatars.githubusercontent.com/u/5396871?v=4" width="110px;"/><br /><sub>Grant Le Roux</sub>](https://github.com/cram42)<br />[💻](https://github.com/snipe/snipe-it/commits?author=cram42 "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

View file

@ -243,7 +243,7 @@ class LdapSync extends Command
$user->jobtitle = $item['jobtitle'];
$user->country = $item['country'];
$user->department_id = $department->id;
$user->location_id = $location->id;
$user->location_id = $location ? $location->id : null;
if($item['manager'] != null) {
// Check Cache first

View file

@ -1220,10 +1220,60 @@ class Helper
return true;
\Log::debug('app locked!');
}
return false;
}
/**
* Conversion between units of measurement
*
* @author Grant Le Roux <grant.leroux+snipe-it@gmail.com>
* @since 5.0
* @param float $value Measurement value to convert
* @param string $srcUnit Source unit of measurement
* @param string $dstUnit Destination unit of measurement
* @param int $round Round the result to decimals (Default false - No rounding)
* @return float
*/
public static function convertUnit($value, $srcUnit, $dstUnit, $round=false) {
$srcFactor = static::getUnitConversionFactor($srcUnit);
$dstFactor = static::getUnitConversionFactor($dstUnit);
$output = $value * $srcFactor / $dstFactor;
return ($round !== false) ? round($output, $round) : $output;
}
/**
* Get conversion factor from unit of measurement to mm
*
* @author Grant Le Roux <grant.leroux+snipe-it@gmail.com>
* @since 5.0
* @param string $unit Unit of measurement
* @return float
*/
public static function getUnitConversionFactor($unit) {
switch (strtolower($unit)) {
case 'mm':
return 1.0;
case 'cm':
return 10.0;
case 'm':
return 1000.0;
case 'in':
return 25.4;
case 'ft':
return 12 * static::getUnitConversionFactor('in');
case 'yd':
return 3 * static::getUnitConversionFactor('ft');
case 'pt':
return (1 / 72) * static::getUnitConversionFactor('in');
default:
throw new \InvalidArgumentException('Unit: \'' . $unit . '\' is not supported');
return false;
}
}
/*
* I know it's gauche to return a shitty HTML string, but this is just a helper and since it will be the same every single time,

View file

@ -126,12 +126,13 @@ class AccessoriesController extends Controller
public function getClone($accessoryId = null)
{
$this->authorize('create', Accesory::class);
$this->authorize('create', Accessory::class);
// Check if the asset exists
if (is_null($accessory_to_clone = Accessory::find($accessoryId))) {
// Redirect to the asset management page
return redirect()->route('accessory.index')->with('error', trans('admin/accessories/message.does_not_exist'));
return redirect()->route('accessories.index')
->with('error', trans('admin/accessories/message.does_not_exist', ['id' => $accessoryId]));
}
$accessory = clone $accessory_to_clone;

View file

@ -29,6 +29,7 @@ class CompaniesController extends Controller
'name',
'phone',
'fax',
'email',
'created_at',
'updated_at',
'users_count',
@ -49,6 +50,10 @@ class CompaniesController extends Controller
$companies->where('name', '=', $request->input('name'));
}
if ($request->filled('email')) {
$companies->where('email', '=', $request->input('email'));
}
// Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $companies->count()) ? $companies->count() : abs($request->input('offset'));
@ -168,6 +173,7 @@ class CompaniesController extends Controller
$companies = Company::select([
'companies.id',
'companies.name',
'companies.email',
'companies.image',
]);

View file

@ -0,0 +1,71 @@
<?php
namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\LabelsTransformer;
use App\Models\Labels\Label;
use Illuminate\Http\Request;
use Illuminate\Support\ItemNotFoundException;
use Auth;
class LabelsController extends Controller
{
/**
* Returns JSON listing of all labels.
*
* @author Grant Le Roux <grant.leroux+snipe-it@gmail.com>
* @return JsonResponse
*/
public function index(Request $request)
{
$this->authorize('view', Label::class);
$labels = Label::find();
if ($request->filled('search')) {
$search = $request->get('search');
$labels = $labels->filter(function ($label, $index) use ($search) {
return stripos($label->getName(), $search) !== false;
});
}
$total = $labels->count();
$offset = $request->get('offset', 0);
$offset = ($offset > $total) ? $total : $offset;
$maxLimit = config('app.max_results');
$limit = $request->get('limit', $maxLimit);
$limit = ($limit > $maxLimit) ? $maxLimit : $limit;
$labels = $labels->skip($offset)->take($limit);
return (new LabelsTransformer)->transformLabels($labels, $total, $request);
}
/**
* Returns JSON with information about a label for detail view.
*
* @author Grant Le Roux <grant.leroux+snipe-it@gmail.com>
* @param string $labelName
* @return JsonResponse
*/
public function show(string $labelName)
{
$labelName = str_replace('/', '\\', $labelName);
try {
$label = Label::find($labelName);
} catch(ItemNotFoundException $e) {
return response()
->json(
Helper::formatStandardApiResponse('error', null, trans('admin/labels/message.does_not_exist')),
404
);
}
$this->authorize('view', $label);
return (new LabelsTransformer)->transformLabel($label);
}
}

View file

@ -14,6 +14,7 @@ use App\Models\Location;
use App\Models\Setting;
use App\Models\Statuslabel;
use App\Models\User;
use App\View\Label;
use Auth;
use Carbon\Carbon;
use DB;
@ -453,11 +454,12 @@ class AssetsController extends Controller
* @since [v3.0]
* @return Redirect
*/
public function getAssetByTag(Request $request)
public function getAssetByTag(Request $request, $tag=null)
{
$tag = $tag ? $tag : $request->get('assetTag');
$topsearch = ($request->get('topsearch') == 'true');
if (! $asset = Asset::where('asset_tag', '=', $request->get('assetTag'))->first()) {
if (! $asset = Asset::where('asset_tag', '=', $tag)->first()) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
$this->authorize('view', $asset);
@ -554,9 +556,11 @@ class AssetsController extends Controller
$asset = Asset::find($assetId);
$this->authorize('view', $asset);
return view('hardware/labels')
->with('assets', Asset::find($asset))
return (new Label())
->with('assets', collect([ $asset ]))
->with('settings', Setting::getSettings())
->with('template', request()->get('template'))
->with('offset', request()->get('offset'))
->with('bulkedit', false)
->with('count', 0);
}

View file

@ -8,6 +8,7 @@ use App\Http\Controllers\CheckInOutRequest;
use App\Http\Controllers\Controller;
use App\Models\Asset;
use App\Models\Setting;
use App\View\Label;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
@ -45,7 +46,7 @@ class BulkAssetsController extends Controller
switch ($request->input('bulk_actions')) {
case 'labels':
$this->authorize('view', Asset::class);
return view('hardware/labels')
return (new Label)
->with('assets', Asset::find($asset_ids))
->with('settings', Setting::getSettings())
->with('bulkedit', true)

View file

@ -62,6 +62,7 @@ final class CompaniesController extends Controller
$company->name = $request->input('name');
$company->phone = $request->input('phone');
$company->fax = $request->input('fax');
$company->email = $request->input('email');
$company = $request->handleImages($company);
@ -115,6 +116,7 @@ final class CompaniesController extends Controller
$company->name = $request->input('name');
$company->phone = $request->input('phone');
$company->fax = $request->input('fax');
$company->email = $request->input('email');
$company = $request->handleImages($company);
@ -123,8 +125,7 @@ final class CompaniesController extends Controller
->with('success', trans('admin/companies/message.update.success'));
}
return redirect()->route('companies.edit', ['company' => $companyId])
->with('error', trans('admin/companies/message.update.error'));
return redirect()->back()->withInput()->withErrors($company->getErrors());
}
/**

View file

@ -94,7 +94,7 @@ class CustomFieldsetsController extends Controller
$this->authorize('create', CustomField::class);
$fieldset = new CustomFieldset([
'name' => e($request->get('name')),
'name' => $request->get('name'),
'user_id' => Auth::user()->id,
]);

View file

@ -0,0 +1,77 @@
<?php
namespace App\Http\Controllers;
use App\Models\Asset;
use App\Models\AssetModel;
use App\Models\Category;
use App\Models\Company;
use App\Models\Labels\Label;
use App\Models\Manufacturer;
use App\Models\Setting;
use App\Models\User;
use App\View\Label as LabelView;
use Illuminate\Support\Facades\Storage;
class LabelsController extends Controller
{
/**
* Returns the Label view with test data
*
* @author Grant Le Roux <grant.leroux+snipe-it@gmail.com>
* @param string $labelName
* @return \Illuminate\Contracts\View\View
*/
public function show(string $labelName)
{
$labelName = str_replace('/', '\\', $labelName);
$template = Label::find($labelName);
$exampleAsset = new Asset();
$exampleAsset->id = 999999;
$exampleAsset->name = 'AST-AB-CD-1234';
$exampleAsset->asset_tag = 'TCA-00001';
$exampleAsset->serial = 'SN9876543210';
$exampleAsset->company = new Company();
$exampleAsset->company->id = 999999;
$exampleAsset->company->name = 'Test Company Limited';
$exampleAsset->company->image = 'company-image-test.png';
$exampleAsset->assignedto = new User();
$exampleAsset->assignedto->id = 999999;
$exampleAsset->assignedto->first_name = 'Test';
$exampleAsset->assignedto->last_name = 'Person';
$exampleAsset->assignedto->username = 'Test.Person';
$exampleAsset->assignedto->employee_num = '0123456789';
$exampleAsset->model = new AssetModel();
$exampleAsset->model->id = 999999;
$exampleAsset->model->name = 'Test Model';
$exampleAsset->model->model_number = 'MDL5678';
$exampleAsset->model->manufacturer = new Manufacturer();
$exampleAsset->model->manufacturer->id = 999999;
$exampleAsset->model->manufacturer->name = 'Test Manufacturing Inc.';
$exampleAsset->model->category = new Category();
$exampleAsset->model->category->id = 999999;
$exampleAsset->model->category->name = 'Test Category';
$settings = Setting::getSettings();
if (request()->has('settings')) {
$overrides = request()->get('settings');
foreach ($overrides as $key => $value) {
$settings->$key = $value;
}
}
return (new LabelView())
->with('assets', collect([$exampleAsset]))
->with('settings', $settings)
->with('template', $template)
->with('bulkedit', false)
->with('count', 0);
return redirect()->route('home')->with('error', trans('admin/labels/message.does_not_exist'));
}
}

View file

@ -590,7 +590,7 @@ class ReportsController extends Controller
$executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
\Log::debug('Added headers: '.$executionTime);
$assets = \App\Models\Company::scopeCompanyables(Asset::select('assets.*'))->with(
$assets = Asset::select('assets.*')->with(
'location', 'assetstatus', 'company', 'defaultLoc', 'assignedTo',
'model.category', 'model.manufacturer', 'supplier');

View file

@ -827,6 +827,14 @@ class SettingsController extends Controller
if (is_null($setting = Setting::getSettings())) {
return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
}
$setting->label2_enable = $request->input('label2_enable');
$setting->label2_template = $request->input('label2_template');
$setting->label2_title = $request->input('label2_title');
$setting->label2_asset_logo = $request->input('label2_asset_logo');
$setting->label2_1d_type = $request->input('label2_1d_type');
$setting->label2_2d_type = $request->input('label2_2d_type');
$setting->label2_2d_target = $request->input('label2_2d_target');
$setting->label2_fields = $request->input('label2_fields');
$setting->labels_per_page = $request->input('labels_per_page');
$setting->labels_width = $request->input('labels_width');
$setting->labels_height = $request->input('labels_height');
@ -875,7 +883,7 @@ class SettingsController extends Controller
}
if ($setting->save()) {
return redirect()->route('settings.index')
return redirect()->route('settings.labels.index')
->with('success', trans('admin/settings/message.update.success'));
}

View file

@ -0,0 +1,67 @@
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class CategoryEditForm extends Component
{
public $defaultEulaText;
public $eulaText;
public $originalSendCheckInEmailValue;
public $requireAcceptance;
public $sendCheckInEmail;
public $useDefaultEula;
public function mount()
{
$this->originalSendCheckInEmailValue = $this->sendCheckInEmail;
if ($this->eulaText || $this->useDefaultEula) {
$this->sendCheckInEmail = 1;
}
}
public function render()
{
return view('livewire.category-edit-form');
}
public function updated($property, $value)
{
if (! in_array($property, ['eulaText', 'useDefaultEula'])) {
return;
}
$this->sendCheckInEmail = $this->eulaText || $this->useDefaultEula ? 1 : $this->originalSendCheckInEmailValue;
}
public function getShouldDisplayEmailMessageProperty(): bool
{
return $this->eulaText || $this->useDefaultEula;
}
public function getEmailMessageProperty(): string
{
if ($this->useDefaultEula) {
return trans('admin/categories/general.email_will_be_sent_due_to_global_eula');
}
return trans('admin/categories/general.email_will_be_sent_due_to_category_eula');
}
public function getEulaTextDisabledProperty()
{
return (bool)$this->useDefaultEula;
}
public function getSendCheckInEmailDisabledProperty()
{
return $this->eulaText || $this->useDefaultEula;
}
}

View file

@ -215,6 +215,7 @@ class Importer extends Component
'manufacturer' => trans('general.manufacturer'),
'order_number' => trans('general.order_number'),
'image' => trans('general.importer.image_filename'),
'asset_eol_date' => trans('admin/hardware/form.eol_date'),
/**
* Checkout fields:
* Assets can be checked out to other assets, people, or locations, but we currently

View file

@ -28,6 +28,7 @@ class CompaniesTransformer
'name' => e($company->name),
'phone' => ($company->phone!='') ? e($company->phone): null,
'fax' => ($company->fax!='') ? e($company->fax): null,
'email' => ($company->email!='') ? e($company->email): null,
'image' => ($company->image) ? Storage::disk('public')->url('companies/'.e($company->image)) : null,
'created_at' => Helper::getFormattedDateObject($company->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($company->updated_at, 'datetime'),

View file

@ -0,0 +1,71 @@
<?php
namespace App\Http\Transformers;
use App\Helpers\Helper;
use App\Models\Labels\Label;
use App\Models\Labels\Sheet;
use App\Models\Labels\RectangleSheet;
use Illuminate\Support\Collection;
class LabelsTransformer
{
public function transformLabels(Collection $labels, $total)
{
$array = [];
foreach ($labels as $label) {
$array[] = self::transformLabel($label);
}
return (new DatatablesTransformer)->transformDatatables($array, $total);
}
public function transformLabel(Label $label)
{
$array = [
'name' => $label->getName(),
'unit' => $label->getUnit(),
'width' => $label->getWidth(),
'height' => $label->getHeight(),
'margin_top' => $label->getMarginTop(),
'margin_bottom' => $label->getMarginBottom(),
'margin_left' => $label->getMarginLeft(),
'margin_right' => $label->getMarginRight(),
'support_asset_tag' => $label->getSupportAssetTag(),
'support_1d_barcode' => $label->getSupport1DBarcode(),
'support_2d_barcode' => $label->getSupport2DBarcode(),
'support_fields' => $label->getSupportFields(),
'support_logo' => $label->getSupportLogo(),
'support_title' => $label->getSupportTitle(),
];
if ($label instanceof Sheet) {
$array['sheet_info'] = [
'label_width' => $label->getLabelWidth(),
'label_height' => $label->getLabelHeight(),
'label_margin_top' => $label->getLabelMarginTop(),
'label_margin_bottom' => $label->getLabelMarginBottom(),
'label_margin_left' => $label->getLabelMarginLeft(),
'label_margin_right' => $label->getLabelMarginRight(),
'labels_per_page' => $label->getLabelsPerPage(),
'label_border' => $label->getLabelBorder(),
];
}
if ($label instanceof RectangleSheet) {
$array['rectanglesheet_info'] = [
'columns' => $label->getColumns(),
'rows' => $label->getRows(),
'column_spacing' => $label->getLabelColumnSpacing(),
'row_spacing' => $label->getLabelRowSpacing(),
];
}
return $array;
}
}

View file

@ -24,6 +24,9 @@ final class Company extends SnipeModel
// Declare the rules for the model validation
protected $rules = [
'name' => 'required|min:1|max:255|unique:companies,name',
'fax' => 'min:7|max:35|nullable',
'phone' => 'min:7|max:35|nullable',
'email' => 'email|max:150|nullable',
];
protected $presenter = \App\Presenters\CompanyPresenter::class;
@ -45,7 +48,7 @@ final class Company extends SnipeModel
*
* @var array
*/
protected $searchableAttributes = ['name', 'phone', 'fax', 'created_at', 'updated_at'];
protected $searchableAttributes = ['name', 'phone', 'fax', 'email', 'created_at', 'updated_at'];
/**
* The relations and their attributes that should be included when searching the model.
@ -63,6 +66,7 @@ final class Company extends SnipeModel
'name',
'phone',
'fax',
'email',
];
private static function isFullMultipleCompanySupportEnabled()

View file

@ -0,0 +1,224 @@
<?php
namespace App\Models\Labels;
use App\Helpers\Helper;
use App\Models\Setting;
class DefaultLabel extends RectangleSheet
{
private const BARCODE1D_SIZE = 0.15;
private const BARCODE2D_SIZE = 0.76;
private const BARCODE2D_MARGIN = 0.075;
private const LOGO_SIZE = [0.75, 0.50];
private const LOGO_MARGIN = 0.05;
private const TEXT_MARGIN = 0.04;
private float $textSize;
private float $labelWidth;
private float $labelHeight;
private float $labelSpacingH;
private float $labelSpacingV;
private float $pageMarginTop;
private float $pageMarginBottom;
private float $pageMarginLeft;
private float $pageMarginRight;
private float $pageWidth;
private float $pageHeight;
private int $columns;
private int $rows;
public function __construct() {
$settings = Setting::getSettings();
$this->textSize = Helper::convertUnit($settings->labels_fontsize, 'pt', 'in');
$this->labelWidth = $settings->labels_width;
$this->labelHeight = $settings->labels_height;
$this->labelSpacingH = $settings->labels_display_sgutter;
$this->labelSpacingV = $settings->labels_display_bgutter;
$this->pageMarginTop = $settings->labels_pmargin_top;
$this->pageMarginBottom = $settings->labels_pmargin_bottom;
$this->pageMarginLeft = $settings->labels_pmargin_left;
$this->pageMarginRight = $settings->labels_pmargin_right;
$this->pageWidth = $settings->labels_pagewidth;
$this->pageHeight = $settings->labels_pageheight;
$usableWidth = $this->pageWidth - $this->pageMarginLeft - $this->pageMarginRight;
$usableHeight = $this->pageHeight - $this->pageMarginTop - $this->pageMarginBottom;
$this->columns = ($usableWidth + $this->labelSpacingH) / ($this->labelWidth + $this->labelSpacingH);
$this->rows = ($usableHeight + $this->labelSpacingV) / ($this->labelHeight + $this->labelSpacingV);
}
public function getUnit() { return 'in'; }
public function getPageWidth() { return $this->pageWidth; }
public function getPageHeight() { return $this->pageHeight; }
public function getPageMarginTop() { return $this->pageMarginTop; }
public function getPageMarginBottom() { return $this->pageMarginBottom; }
public function getPageMarginLeft() { return $this->pageMarginLeft; }
public function getPageMarginRight() { return $this->pageMarginRight; }
public function getColumns() { return $this->columns; }
public function getRows() { return $this->rows; }
public function getLabelBorder() { return 0.01; }
public function getLabelWidth() { return $this->labelWidth; }
public function getLabelHeight() { return $this->labelHeight; }
public function getLabelMarginTop() { return 0; }
public function getLabelMarginBottom() { return 0; }
public function getLabelMarginLeft() { return 0; }
public function getLabelMarginRight() { return 0; }
public function getLabelColumnSpacing() { return $this->labelSpacingH; }
public function getLabelRowSpacing() { return $this->labelSpacingV; }
public function getSupportAssetTag() { return false; }
public function getSupport1DBarcode() { return true; }
public function getSupport2DBarcode() { return true; }
public function getSupportFields() { return 4; }
public function getSupportTitle() { return true; }
public function getSupportLogo() { return true; }
public function preparePDF($pdf) {}
public function write($pdf, $record) {
$asset = $record->get('asset');
$settings = Setting::getSettings();
$textY = 0;
$textX1 = 0;
$textX2 = $this->getLabelWidth();
// 1D Barcode
if ($record->get('barcode1d')) {
static::write1DBarcode(
$pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type,
0.05, $this->getLabelHeight() - self::BARCODE1D_SIZE,
$this->getLabelWidth() - 0.1, self::BARCODE1D_SIZE
);
}
// 2D Barcode
if ($record->get('barcode2d')) {
static::write2DBarcode(
$pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type,
0, 0, self::BARCODE2D_SIZE, self::BARCODE2D_SIZE
);
$textX1 += self::BARCODE2D_SIZE + self::BARCODE2D_MARGIN;
}
// Logo
if ($record->get('logo')) {
$logoSize = static::writeImage(
$pdf, $record->get('logo'),
$this->labelWidth - self::LOGO_SIZE[0], 0,
self::LOGO_SIZE[0], self::LOGO_SIZE[1],
'R', 'T', 300, true, false, 0
);
$textX2 -= ($logoSize[0] + self::LOGO_MARGIN);
}
$textW = $textX2 - $textX1;
// Title
if ($record->get('title')) {
static::writeText(
$pdf, $record->get('title'),
$textX1, 0,
'freesans', 'b', $this->textSize, 'L',
$textW, $this->textSize,
true, 0
);
$textY += $this->textSize + self::TEXT_MARGIN;
}
// Fields
$fieldsDone = 0;
if ($settings->labels_display_name && $fieldsDone < $this->getSupportFields()) {
if ($asset->name) {
static::writeText(
$pdf, 'N: '.$asset->name,
$textX1, $textY,
'freesans', '', $this->textSize, 'L',
$textW, $this->textSize,
true, 0
);
$textY += $this->textSize + self::TEXT_MARGIN;
$fieldsDone++;
}
}
if ($settings->labels_display_company_name && $fieldsDone < $this->getSupportFields()) {
if ($asset->company) {
static::writeText(
$pdf, 'C: '.$asset->company->name,
$textX1, $textY,
'freesans', '', $this->textSize, 'L',
$textW, $this->textSize,
true, 0
);
$textY += $this->textSize + self::TEXT_MARGIN;
$fieldsDone++;
}
}
if ($settings->labels_display_tag && $fieldsDone < $this->getSupportFields()) {
if ($asset->asset_tag) {
static::writeText(
$pdf, 'T: '.$asset->asset_tag,
$textX1, $textY,
'freesans', '', $this->textSize, 'L',
$textW, $this->textSize,
true, 0
);
$textY += $this->textSize + self::TEXT_MARGIN;
$fieldsDone++;
}
}
if ($settings->labels_display_serial && $fieldsDone < $this->getSupportFields()) {
if ($asset->serial) {
static::writeText(
$pdf, 'S: '.$asset->serial,
$textX1, $textY,
'freesans', '', $this->textSize, 'L',
$textW, $this->textSize,
true, 0
);
$textY += $this->textSize + self::TEXT_MARGIN;
$fieldsDone++;
}
}
if ($settings->labels_display_model && $fieldsDone < $this->getSupportFields()) {
if ($asset->model) {
static::writeText(
$pdf, 'M: '.$asset->model->name,
$textX1, $textY,
'freesans', '', $this->textSize, 'L',
$textW, $this->textSize,
true, 0
);
$textY += $this->textSize + self::TEXT_MARGIN;
$fieldsDone++;
}
}
}
}
?>

View file

@ -0,0 +1,39 @@
<?php
namespace App\Models\Labels;
use App\Models\Asset;
use Illuminate\Support\Collection;
class Field {
protected Collection $options;
public function getOptions() { return $this->options; }
public function setOptions($options) {
$tempCollect = collect($options);
if (!$tempCollect->contains(fn($o) => !is_subclass_of($o, FieldOption::class))) {
$this->options = $options;
}
}
public function toArray(Asset $asset) { return Field::makeArray($this, $asset); }
/* Statics */
public static function makeArray(Field $field, Asset $asset) {
return $field->getOptions()
->map(fn($option) => $option->toArray($asset))
->filter(fn($result) => $result['value'] != null);
}
public static function makeString(Field $option) {
return implode('|', $option->getOptions());
}
public static function fromString(string $theString) {
$field = new Field();
$field->options = collect(explode('|', $theString))
->filter(fn($optionString) => !empty($optionString))
->map(fn($optionString) => FieldOption::fromString($optionString));
return $field;
}
}

View file

@ -0,0 +1,49 @@
<?php
namespace App\Models\Labels;
use App\Models\Asset;
use Illuminate\Support\Collection;
class FieldOption {
protected string $label;
public function getLabel() { return $this->label; }
protected string $dataSource;
public function getDataSource() { return $this->dataSource; }
public function getValue(Asset $asset) {
$dataPath = collect(explode('.', $this->dataSource));
return $dataPath->reduce(function ($myValue, $path) {
try { return $myValue ? $myValue->{$path} : ${$myValue}; }
catch (\Exception $e) { return $myValue; }
}, $asset);
}
public function toArray(Asset $asset=null) { return FieldOption::makeArray($this, $asset); }
public function toString() { return FieldOption::makeString($this); }
/* Statics */
public static function makeArray(FieldOption $option, Asset $asset=null) {
return [
'label' => $option->getLabel(),
'dataSource' => $option->getDataSource(),
'value' => $asset ? $option->getValue($asset) : null
];
}
public static function makeString(FieldOption $option) {
return $option->getLabel() . '=' . $option->getDataSource();
}
public static function fromString(string $theString) {
$parts = explode('=', $theString);
if (count($parts) == 2) {
$option = new FieldOption();
$option->label = $parts[0];
$option->dataSource = $parts[1];
return $option;
}
}
}

598
app/Models/Labels/Label.php Normal file
View file

@ -0,0 +1,598 @@
<?php
namespace App\Models\Labels;
use App\Helpers\Helper;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\File;
use TCPDF;
use TCPDF_STATIC;
/**
* Model for Labels.
*
* @version v1.0
*/
abstract class Label
{
/**
* Returns the unit of measure used
* 'pt', 'mm', 'cm', 'in'
*
* @return string
*/
public abstract function getUnit();
/**
* Returns the label's width in getUnit() units
*
* @return float
*/
public abstract function getWidth();
/**
* Returns the label's height in getUnit() units
*
* @return float
*/
public abstract function getHeight();
/**
* Returns the label's top margin in getUnit() units
*
* @return float
*/
public abstract function getMarginTop();
/**
* Returns the label's bottom margin in getUnit() units
*
* @return float
*/
public abstract function getMarginBottom();
/**
* Returns the label's left margin in getUnit() units
*
* @return float
*/
public abstract function getMarginLeft();
/**
* Returns the label's right margin in getUnit() units
*
* @return float
*/
public abstract function getMarginRight();
/**
* Returns whether the template supports an asset tag.
*
* @return bool
*/
public abstract function getSupportAssetTag();
/**
* Returns whether the template supports a 1D barcode.
*
* @return bool
*/
public abstract function getSupport1DBarcode();
/**
* Returns whether the template supports a 2D barcode.
*
* @return bool
*/
public abstract function getSupport2DBarcode();
/**
* Returns the number of fields the template supports.
*
* @return int
*/
public abstract function getSupportFields();
/**
* Returns whether the template supports a logo.
*
* @return bool
*/
public abstract function getSupportLogo();
/**
* Returns whether the template supports a title.
*
* @return bool
*/
public abstract function getSupportTitle();
/**
* Make changes to the PDF properties here. OPTIONAL.
*
* @param TCPDF $pdf The TCPDF instance
*/
public abstract function preparePDF(TCPDF $pdf);
/**
* Write single data record as content here.
*
* @param TCPDF $pdf The TCPDF instance
* @param Collection $record A data record
*/
public abstract function write(TCPDF $pdf, Collection $record);
/**
* Handle the data here. Override for multiple-per-page handling
*
* @param TCPDF $pdf The TCPDF instance
* @param Collection $data The data
*/
public function writeAll(TCPDF $pdf, Collection $data) {
$data->each(function ($record, $index) use ($pdf) {
$pdf->AddPage();
$this->write($pdf, $record);
});
}
/**
* Returns the qualified class name relative to the Label class's namespace.
*
* @return string
*/
public final function getName() {
$refClass = new \ReflectionClass(Label::class);
return str_replace($refClass->getNamespaceName() . '\\', '', get_class($this));
}
/**
* Returns the label's orientation as a string.
* 'L' = Landscape
* 'P' = Portrait
*
* @return string
*/
public final function getOrientation() {
return ($this->getWidth() >= $this->getHeight()) ? 'L' : 'P';
}
/**
* Returns the label's printable area as an object.
*
* @return object [ 'x1'=>0.00, 'y1'=>0.00, 'x2'=>0.00, 'y2'=>0.00, 'w'=>0.00, 'h'=>0.00 ]
*/
public final function getPrintableArea() {
return (object)[
'x1' => $this->getMarginLeft(),
'y1' => $this->getMarginTop(),
'x2' => $this->getWidth() - $this->getMarginRight(),
'y2' => $this->getHeight() - $this->getMarginBottom(),
'w' => $this->getWidth() - $this->getMarginLeft() - $this->getMarginRight(),
'h' => $this->getHeight() - $this->getMarginTop() - $this->getMarginBottom(),
];
}
/**
* Write a text cell.
*
* @param TCPDF $pdf The TCPDF instance
* @param string $text The text to write. Supports 'some **bold** text'.
* @param float $x X position of top-left
* @param float $y Y position of top-left
* @param string $font The font family
* @param string $style The font style
* @param int $size The font size in getUnit() units
* @param string $align Align text in the box. 'L' left, 'R' right, 'C' center.
* @param float $width Force text box width. NULL to auto-fit.
* @param float $height Force text box height. NULL to auto-fit.
* @param bool $squash Squash text if it's too big
* @param int $border Thickness of border. Default = 0.
* @param int $spacing Letter spacing. Default = 0.
*/
public final function writeText(TCPDF $pdf, $text, $x, $y, $font=null, $style=null, $size=null, $align='L', $width=null, $height=null, $squash=false, $border=0, $spacing=0) {
$prevFamily = $pdf->getFontFamily();
$prevStyle = $pdf->getFontStyle();
$prevSizePt = $pdf->getFontSizePt();
$text = !empty($text) ? $text : '';
$fontFamily = !empty($font) ? $font : $prevFamily;
$fontStyle = !empty($style) ? $style : $prevStyle;
if ($size) $fontSizePt = Helper::convertUnit($size, $this->getUnit(), 'pt', true);
else $fontSizePt = $prevSizePt;
$pdf->SetFontSpacing($spacing);
$parts = collect(explode('**', $text))
->map(function ($part, $index) use ($pdf, $fontFamily, $fontStyle, $fontSizePt) {
$modStyle = ($index % 2 == 1) ? 'B' : $fontStyle;
$pdf->setFont($fontFamily, $modStyle, $fontSizePt);
return [
'text' => $part,
'text_width' => $pdf->GetStringWidth($part),
'font_family' => $fontFamily,
'font_style' => $modStyle,
'font_size' => $fontSizePt,
];
});
$textWidth = $parts->reduce(function ($carry, $part) { return $carry += $part['text_width']; });
$cellWidth = !empty($width) ? $width : $textWidth;
if ($squash && ($textWidth > 0)) {
$scaleFactor = min(1.0, $cellWidth / $textWidth);
$parts = $parts->map(function ($part, $index) use ($scaleFactor) {
$part['text_width'] = $part['text_width'] * $scaleFactor;
return $part;
});
}
$cellHeight = !empty($height) ? $height : Helper::convertUnit($fontSizePt, 'pt', $this->getUnit());
if ($border) {
$prevLineWidth = $pdf->getLineWidth();
$pdf->setLineWidth($border);
$pdf->Rect($x, $y, $cellWidth, $cellHeight);
$pdf->setLineWidth($prevLineWidth);
}
switch($align) {
case 'R': $startX = ($x + $cellWidth) - min($cellWidth, $textWidth); break;
case 'C': $startX = ($x + ($cellWidth / 2)) - (min($cellWidth, $textWidth) / 2); break;
case 'L':
default: $startX = $x; break;
}
$parts->reduce(function ($currentX, $part) use ($pdf, $y, $cellHeight) {
$pdf->SetXY($currentX, $y);
$pdf->setFont($part['font_family'], $part['font_style'], $part['font_size']);
$pdf->Cell($part['text_width'], $cellHeight, $part['text'], 0, 0, '', false, '', 1, true);
return $currentX += $part['text_width'];
}, $startX);
$pdf->SetFont($prevFamily, $prevStyle, $prevSizePt);
$pdf->SetFontSpacing(0);
}
/**
* Write an image.
*
* @param TCPDF $pdf The TCPDF instance
* @param string $image The image to write
* @param float $x X position of top-left
* @param float $y Y position of top-left
* @param float $width The container width
* @param float $height The container height
* @param string $halign Align text in the box. 'L' left, 'R' right, 'C' center. Default 'L'.
* @param string $valign Align text in the box. 'T' top, 'B' bottom, 'C' center. Default 'T'.
* @param int $dpi Pixels per inch
* @param bool $resize Resize to fit container
* @param bool $stretch Stretch (vs Scale) to fit container
* @param int $border Thickness of border. Default = 0.
*
* @return array Returns the final calculated size [w,h]
*/
public final function writeImage(TCPDF $pdf, $image, $x, $y, $width=null, $height=null, $halign='L', $valign='L', $dpi=300, $resize=false, $stretch=false, $border=0) {
if (empty($image)) return [0,0];
$imageInfo = getimagesize($image);
if (!$imageInfo) return [0,0]; // TODO: SVG or other
$imageWidthPx = $imageInfo[0];
$imageHeightPx = $imageInfo[1];
$imageType = image_type_to_extension($imageInfo[2], false);
$imageRatio = $imageWidthPx / $imageHeightPx;
$dpu = Helper::convertUnit($dpi, $this->getUnit(), 'in');
$imageWidth = $imageWidthPx / $dpu;
$imageHeight = $imageHeightPx / $dpu;
$outputWidth = $imageWidth;
$outputHeight = $imageHeight;
if ($resize) {
// Assign specified parameters
$limitWidth = $width;
$limitHeight = $height;
// If not, try calculating from the other dimension
$limitWidth = ($limitWidth > 0) ? $limitWidth : ($limitHeight / $imageRatio);
$limitHeight = ($limitHeight > 0) ? $limitHeight : ($limitWidth * $imageRatio);
// If not, just use the image size
$limitWidth = ($limitWidth > 0) ? $limitWidth : $imageWidth;
$limitHeight = ($limitHeight > 0) ? $limitHeight : $imageHeight;
$scaleWidth = $limitWidth / $imageWidth;
$scaleHeight = $limitHeight / $imageHeight;
// If non-stretch, make both scales factors equal
if (!$stretch) {
// Do we need to scale down at all? That's most important.
if (($scaleWidth < 1.0) || ($scaleHeight < 1.0)) {
// Choose largest scale-down
$scaleWidth = min($scaleWidth, $scaleHeight);
} else {
// Choose smallest scale-up
$scaleWidth = min(max($scaleWidth, 1.0), max($scaleHeight, 1.0));
}
$scaleHeight = $scaleWidth;
}
$outputWidth = $imageWidth * $scaleWidth;
$outputHeight = $imageHeight * $scaleHeight;
}
// Container
$containerWidth = !empty($width) ? $width : $outputWidth;
$containerHeight = !empty($height) ? $height : $outputHeight;
// Horizontal Position
switch ($halign) {
case 'R': $originX = ($x + $containerWidth) - $outputWidth; break;
case 'C': $originX = ($x + ($containerWidth / 2)) - ($outputWidth / 2); break;
case 'L':
default: $originX = $x; break;
}
// Vertical Position
switch ($valign) {
case 'B': $originY = ($y + $containerHeight) - $outputHeight; break;
case 'C': $originY = ($y + ($containerHeight / 2)) - ($outputHeight / 2); break;
case 'T':
default: $originY = $y; break;
}
// Actual Image
$pdf->Image($image, $originX, $originY, $outputWidth, $outputHeight, $imageType, '', '', true);
// Border
if ($border) {
$prevLineWidth = $pdf->getLineWidth();
$pdf->setLineWidth($border);
$pdf->Rect($x, $y, $containerWidth, $containerHeight);
$pdf->setLineWidth($prevLineWidth);
}
return [ $outputWidth, $outputHeight ];
}
/**
* Write a 1D barcode.
*
* @param TCPDF $pdf The TCPDF instance
* @param string $value The barcode content
* @param string $type The barcode type
* @param float $x X position of top-left
* @param float $y Y position of top-left
* @param float $width The container width
* @param float $height The container height
*/
public final function write1DBarcode(TCPDF $pdf, $value, $type, $x, $y, $width, $height) {
if (empty($value)) return;
$pdf->write1DBarcode($value, $type, $x, $y, $width, $height, null, ['stretch'=>true]);
}
/**
* Write a 2D barcode.
*
* @param TCPDF $pdf The TCPDF instance
* @param string $value The barcode content
* @param string $type The barcode type
* @param float $x X position of top-left
* @param float $y Y position of top-left
* @param float $width The container width
* @param float $height The container height
*/
public final function write2DBarcode(TCPDF $pdf, $value, $type, $x, $y, $width, $height) {
if (empty($value)) return;
$pdf->write2DBarcode($value, $type, $x, $y, $width, $height, null, ['stretch'=>true]);
}
/**
* Checks the template is internally valid
*/
public final function validate() {
$this->validateUnits();
$this->validateSize();
$this->validateMargins();
$this->validateSupport();
}
private function validateUnits() {
$validUnits = [ 'pt', 'mm', 'cm', 'in' ];
$unit = $this->getUnit();
if (!in_array(strtolower($unit), $validUnits)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_value', [
'name' => 'getUnit()',
'expected' => '[ \''.implode('\', \'', $validUnits).'\' ]',
'actual' => '\''.$unit.'\''
]));
}
}
private function validateSize() {
$width = $this->getWidth();
if (!is_numeric($width) || is_string($width)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getWidth()',
'expected' => 'float',
'actual' => gettype($width)
]));
}
$height = $this->getHeight();
if (!is_numeric($height) || is_string($height)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getHeight()',
'expected' => 'float',
'actual' => gettype($height)
]));
}
}
private function validateMargins() {
$marginTop = $this->getMarginTop();
if (!is_numeric($marginTop) || is_string($marginTop)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getMarginTop()',
'expected' => 'float',
'actual' => gettype($marginTop)
]));
}
$marginBottom = $this->getMarginBottom();
if (!is_numeric($marginBottom) || is_string($marginBottom)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getMarginBottom()',
'expected' => 'float',
'actual' => gettype($marginBottom)
]));
}
$marginLeft = $this->getMarginLeft();
if (!is_numeric($marginLeft) || is_string($marginLeft)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getMarginLeft()',
'expected' => 'float',
'actual' => gettype($marginLeft)
]));
}
$marginRight = $this->getMarginRight();
if (!is_numeric($marginRight) || is_string($marginRight)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getMarginRight()',
'expected' => 'float',
'actual' => gettype($marginRight)
]));
}
}
private function validateSupport() {
$support1D = $this->getSupport1DBarcode();
if (!is_bool($support1D)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getSupport1DBarcode()',
'expected' => 'boolean',
'actual' => gettype($support1D)
]));
}
$support2D = $this->getSupport2DBarcode();
if (!is_bool($support2D)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getSupport2DBarcode()',
'expected' => 'boolean',
'actual' => gettype($support2D)
]));
}
$supportFields = $this->getSupportFields();
if (!is_int($supportFields)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getSupportFields()',
'expected' => 'integer',
'actual' => gettype($supportFields)
]));
}
$supportLogo = $this->getSupportLogo();
if (!is_bool($supportLogo)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getSupportLogo()',
'expected' => 'boolean',
'actual' => gettype($supportLogo)
]));
}
$supportTitle = $this->getSupportTitle();
if (!is_bool($supportTitle)) {
throw new \UnexpectedValueException(trans('admin/labels/message.invalid_return_type', [
'name' => 'getSupportTitle()',
'expected' => 'boolean',
'actual' => gettype($supportTitle)
]));
}
}
/**
* Public Static Functions
*/
/**
* Find size of a page by its format.
*
* @param string $format Format name (eg: 'A4', 'LETTER', etc.)
* @param string $orientation 'L' for Landscape, 'P' for Portrait ('L' default)
* @param string $unit Unit of measure to return in ('mm' default)
*
* @return object (object)[ 'width' => (float)123.4, 'height' => (float)123.4 ]
*/
public static function fromFormat($format, $orientation='L', $unit='mm', $round=false) {
$size = collect(TCPDF_STATIC::getPageSizeFromFormat(strtoupper($format)))
->sort()
->map(function ($value) use ($unit) {
return Helper::convertUnit($value, 'pt', $unit);
})
->toArray();
$width = ($orientation == 'L') ? $size[1] : $size[0];
$height = ($orientation == 'L') ? $size[0] : $size[1];
return (object)[
'width' => ($round !== false) ? round($width, $round) : $width,
'height' => ($round !== false) ? round($height, $round) : $height,
];
}
/**
* Find a Label by its path (or just return them all).
*
* Unlike most Models, these are defined by their existence as non-
* abstract classes stored in Models\Labels.
*
* @param string|Arrayable|array|null $path Label path[s]
* @return Collection|Label|null
*/
public static function find($name=null) {
// Find many
if (is_array($name) || $name instanceof Arrayable) {
$labels = collect($name)
->map(function ($thisname) {
return static::find($thisname);
})
->whereNotNull();
return ($labels->count() > 0) ? $labels : null;
}
// Find one
if ($name !== null) {
return static::find()
->sole(function ($label) use ($name) {
return $label->getName() == $name;
});
}
// Find all
return collect(File::allFiles(__DIR__))
->map(function ($file) {
preg_match_all('/\/*(.+?)(?:\/|\.)/', $file->getRelativePathName(), $matches);
return __NAMESPACE__ . '\\' . implode('\\', $matches[1]);
})
->filter(function ($name) {
if (!class_exists($name)) return false;
$refClass = new \ReflectionClass($name);
if ($refClass->isAbstract()) return false;
return $refClass->isSubclassOf(Label::class);
})
->map(function ($name) {
return new $name();
});
}
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Models\Labels;
abstract class RectangleSheet extends Sheet
{
/**
* Returns the number of columns per sheet
*
* @return int
*/
public abstract function getColumns();
/**
* Returns the number of rows per sheet
*
* @return int
*/
public abstract function getRows();
/**
* Returns the spacing between columns
*
* @return int
*/
public abstract function getLabelColumnSpacing();
/**
* Returns the spacing between rows
*
* @return int
*/
public abstract function getLabelRowSpacing();
public function getLabelsPerPage() { return $this->getColumns() * $this->getRows(); }
public function getLabelPosition($index) {
$printIndex = $index + $this->getLabelIndexOffset();
$row = (int)($printIndex / $this->getColumns());
$col = $printIndex - ($row * $this->getColumns());
$x = $this->getPageMarginLeft() + (($this->getLabelWidth() + $this->getLabelColumnSpacing()) * $col);
$y = $this->getPageMarginTop() + (($this->getLabelHeight() + $this->getLabelRowSpacing()) * $row);
return [ $x, $y ];
}
}
?>

209
app/Models/Labels/Sheet.php Normal file
View file

@ -0,0 +1,209 @@
<?php
namespace App\Models\Labels;
abstract class Sheet extends Label
{
protected int $indexOffset = 0;
public function getWidth() { return $this->getPageWidth(); }
public function getHeight() { return $this->getPageHeight(); }
public function getMarginTop() { return $this->getPageMarginTop(); }
public function getMarginBottom() { return $this->getPageMarginBottom(); }
public function getMarginLeft() { return $this->getPageMarginLeft(); }
public function getMarginRight() { return $this->getPageMarginRight(); }
/**
* Returns the page width in getUnit() units
*
* @return float
*/
public abstract function getPageWidth();
/**
* Returns the page height in getUnit() units
*
* @return float
*/
public abstract function getPageHeight();
/**
* Returns the page top margin in getUnit() units
*
* @return float
*/
public abstract function getPageMarginTop();
/**
* Returns the page bottom margin in getUnit() units
*
* @return float
*/
public abstract function getPageMarginBottom();
/**
* Returns the page left margin in getUnit() units
*
* @return float
*/
public abstract function getPageMarginLeft();
/**
* Returns the page right margin in getUnit() units
*
* @return float
*/
public abstract function getPageMarginRight();
/**
* Returns the page width in getUnit() units
*
* @return float
*/
public abstract function getLabelWidth();
/**
* Returns each label's height in getUnit() units
*
* @return float
*/
public abstract function getLabelHeight();
/**
* Returns each label's top margin in getUnit() units
*
* @return float
*/
public abstract function getLabelMarginTop();
/**
* Returns each label's bottom margin in getUnit() units
*
* @return float
*/
public abstract function getLabelMarginBottom();
/**
* Returns each label's left margin in getUnit() units
*
* @return float
*/
public abstract function getLabelMarginLeft();
/**
* Returns each label's right margin in getUnit() units
*
* @return float
*/
public abstract function getLabelMarginRight();
/**
* Returns the number of labels each page supports
*
* @return int
*/
public abstract function getLabelsPerPage();
/**
* Returns label position based on its index
*
* @param int $index
*
* @return array [x,y]
*/
public abstract function getLabelPosition(int $index);
/**
* Returns the border to draw around labels
*
* @return int
*/
public abstract function getLabelBorder();
/**
* Handle the data here. Override for multiple-per-page handling
*
* @param TCPDF $pdf The TCPDF instance
* @param Collection $data The data
*/
public function writeAll($pdf, $data) {
$prevPageNumber = -1;
foreach ($data->toArray() as $recordIndex => $record) {
$pageNumber = (int)($recordIndex / $this->getLabelsPerPage());
if ($pageNumber != $prevPageNumber) {
$pdf->AddPage();
$prevPageNumber = $pageNumber;
}
$pageIndex = $recordIndex - ($this->getLabelsPerPage() * $pageNumber);
$position = $this->getLabelPosition($pageIndex);
$pdf->StartTemplate();
$this->write($pdf, $data->get($recordIndex));
$template = $pdf->EndTemplate();
$pdf->printTemplate($template, $position[0], $position[1]);
if ($this->getLabelBorder()) {
$prevLineWidth = $pdf->GetLineWidth();
$borderThickness = $this->getLabelBorder();
$borderOffset = $borderThickness / 2;
$borderX = $position[0]- $borderOffset;
$borderY = $position[1] - $borderOffset;
$borderW = $this->getLabelWidth() + $borderThickness;
$borderH = $this->getLabelHeight() + $borderThickness;
$pdf->setLineWidth($borderThickness);
$pdf->Rect($borderX, $borderY, $borderW, $borderH);
$pdf->setLineWidth($prevLineWidth);
}
}
}
/**
* Returns each label's orientation as a string.
* 'L' = Landscape
* 'P' = Portrait
*
* @return string
*/
public final function getLabelOrientation() {
return ($this->getLabelWidth() >= $this->getLabelHeight()) ? 'L' : 'P';
}
/**
* Returns each label's printable area as an object.
*
* @return object [ 'x1'=>0.00, 'y1'=>0.00, 'x2'=>0.00, 'y2'=>0.00, 'w'=>0.00, 'h'=>0.00 ]
*/
public final function getLabelPrintableArea() {
return (object)[
'x1' => $this->getLabelMarginLeft(),
'y1' => $this->getLabelMarginTop(),
'x2' => $this->getLabelWidth() - $this->getLabelMarginRight(),
'y2' => $this->getLabelHeight() - $this->getLabelMarginBottom(),
'w' => $this->getLabelWidth() - $this->getLabelMarginLeft() - $this->getLabelMarginRight(),
'h' => $this->getLabelHeight() - $this->getLabelMarginTop() - $this->getLabelMarginBottom(),
];
}
/**
* Returns label index offset (skip positions)
*
* @return int
*/
public function getLabelIndexOffset() { return $this->indexOffset; }
/**
* Sets label index offset (skip positions)
*
* @param int $offset
*
*/
public function setLabelIndexOffset(int $offset) { $this->indexOffset = $offset; }
}
?>

View file

@ -0,0 +1,71 @@
<?php
namespace App\Models\Labels\Sheets\Avery;
use App\Helpers\Helper;
use App\Models\Labels\RectangleSheet;
abstract class L7162 extends RectangleSheet
{
private const PAPER_FORMAT = 'A4';
private const PAPER_ORIENTATION = 'P';
/* Data in pt from Word Template */
private const COLUMN1_X = 13.25;
private const COLUMN2_X = 301.25;
private const ROW1_Y = 37.00;
private const ROW2_Y = 133.00;
private const LABEL_W = 280.80;
private const LABEL_H = 96.00;
private float $pageWidth;
private float $pageHeight;
private float $pageMarginLeft;
private float $pageMarginTop;
private float $columnSpacing;
private float $rowSpacing;
private float $labelWidth;
private float $labelHeight;
public function __construct() {
$paperSize = static::fromFormat(self::PAPER_FORMAT, self::PAPER_ORIENTATION, $this->getUnit(), 0);
$this->pageWidth = $paperSize->width;
$this->pageHeight = $paperSize->height;
$this->pageMarginLeft = Helper::convertUnit(self::COLUMN1_X, 'pt', $this->getUnit());
$this->pageMarginTop = Helper::convertUnit(self::ROW1_Y, 'pt', $this->getUnit());
$columnSpacingPt = self::COLUMN2_X - self::COLUMN1_X - self::LABEL_W;
$this->columnSpacing = Helper::convertUnit($columnSpacingPt, 'pt', $this->getUnit());
$rowSpacingPt = self::ROW2_Y - self::ROW1_Y - self::LABEL_H;
$this->rowSpacing = Helper::convertUnit($rowSpacingPt, 'pt', $this->getUnit());
$this->labelWidth = Helper::convertUnit(self::LABEL_W, 'pt', $this->getUnit());
$this->labelHeight = Helper::convertUnit(self::LABEL_H, 'pt', $this->getUnit());
}
public function getPageWidth() { return $this->pageWidth; }
public function getPageHeight() { return $this->pageHeight; }
public function getPageMarginTop() { return $this->pageMarginTop; }
public function getPageMarginBottom() { return $this->pageMarginTop; }
public function getPageMarginLeft() { return $this->pageMarginLeft; }
public function getPageMarginRight() { return $this->pageMarginLeft; }
public function getColumns() { return 2; }
public function getRows() { return 8; }
public function getLabelColumnSpacing() { return $this->columnSpacing; }
public function getLabelRowSpacing() { return $this->rowSpacing; }
public function getLabelWidth() { return $this->labelWidth; }
public function getLabelHeight() { return $this->labelHeight; }
public function getLabelBorder() { return 0; }
}
?>

View file

@ -0,0 +1,100 @@
<?php
namespace App\Models\Labels\Sheets\Avery;
class L7162_A extends L7162
{
private const BARCODE_MARGIN = 1.60;
private const TAG_SIZE = 4.60;
private const TITLE_SIZE = 4.20;
private const TITLE_MARGIN = 1.40;
private const LABEL_SIZE = 2.20;
private const LABEL_MARGIN = - 0.50;
private const FIELD_SIZE = 4.60;
private const FIELD_MARGIN = 0.30;
public function getUnit() { return 'mm'; }
public function getLabelMarginTop() { return 1.0; }
public function getLabelMarginBottom() { return 1.0; }
public function getLabelMarginLeft() { return 1.0; }
public function getLabelMarginRight() { return 1.0; }
public function getSupportAssetTag() { return true; }
public function getSupport1DBarcode() { return false; }
public function getSupport2DBarcode() { return true; }
public function getSupportFields() { return 4; }
public function getSupportLogo() { return false; }
public function getSupportTitle() { return true; }
public function preparePDF($pdf) {}
public function write($pdf, $record) {
$pa = $this->getLabelPrintableArea();
$usableWidth = $pa->w;
$usableHeight = $pa->h;
$currentX = $pa->x1;
$currentY = $pa->y1;
$titleShiftX = 0;
$barcodeSize = $pa->h - self::TAG_SIZE;
if ($record->has('barcode2d')) {
static::writeText(
$pdf, $record->get('tag'),
$pa->x1, $pa->y2 - self::TAG_SIZE,
'freemono', 'b', self::TAG_SIZE, 'C',
$barcodeSize, self::TAG_SIZE, true, 0
);
static::write2DBarcode(
$pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type,
$pa->x1, $pa->y1,
$barcodeSize, $barcodeSize
);
$currentX += $barcodeSize + self::BARCODE_MARGIN;
$usableWidth -= $barcodeSize + self::BARCODE_MARGIN;
} else {
static::writeText(
$pdf, $record->get('tag'),
$pa->x1, $pa->y1,
'freemono', 'b', self::TITLE_SIZE, 'L',
$barcodeSize, self::TITLE_SIZE, true, 0
);
$titleShiftX = $barcodeSize;
}
if ($record->has('title')) {
static::writeText(
$pdf, $record->get('title'),
$currentX + $titleShiftX, $currentY,
'freesans', '', self::TITLE_SIZE, 'L',
$usableWidth, self::TITLE_SIZE, true, 0
);
$currentY += self::TITLE_SIZE + self::TITLE_MARGIN;
}
foreach ($record->get('fields') as $field) {
static::writeText(
$pdf, $field['label'],
$currentX, $currentY,
'freesans', '', self::LABEL_SIZE, 'L',
$usableWidth, self::LABEL_SIZE, true, 0
);
$currentY += self::LABEL_SIZE + self::LABEL_MARGIN;
static::writeText(
$pdf, $field['value'],
$currentX, $currentY,
'freemono', 'B', self::FIELD_SIZE, 'L',
$usableWidth, self::FIELD_SIZE, true, 0, 0.3
);
$currentY += self::FIELD_SIZE + self::FIELD_MARGIN;
}
}
}
?>

View file

@ -0,0 +1,103 @@
<?php
namespace App\Models\Labels\Sheets\Avery;
class L7162_B extends L7162
{
private const BARCODE_SIZE = 6.00;
private const BARCODE_MARGIN = 1.40;
private const TAG_SIZE = 3.20;
private const LOGO_MAX_WIDTH = 25.00;
private const LOGO_MARGIN = 2.20;
private const TITLE_SIZE = 4.20;
private const TITLE_MARGIN = 1.20;
private const LABEL_SIZE = 2.20;
private const LABEL_MARGIN = - 0.50;
private const FIELD_SIZE = 4.20;
private const FIELD_MARGIN = 0.30;
public function getUnit() { return 'mm'; }
public function getLabelMarginTop() { return 1.0; }
public function getLabelMarginBottom() { return 0; }
public function getLabelMarginLeft() { return 1.0; }
public function getLabelMarginRight() { return 1.0; }
public function getSupportAssetTag() { return true; }
public function getSupport1DBarcode() { return true; }
public function getSupport2DBarcode() { return false; }
public function getSupportFields() { return 3; }
public function getSupportLogo() { return true; }
public function getSupportTitle() { return true; }
public function preparePDF($pdf) {}
public function write($pdf, $record) {
$pa = $this->getLabelPrintableArea();
$usableWidth = $pa->w;
$usableHeight = $pa->h;
$currentX = $pa->x1;
$currentY = $pa->y1;
if ($record->has('barcode1d')) {
static::write1DBarcode(
$pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type,
$pa->x1, $pa->y2 - self::BARCODE_SIZE,
$usableWidth, self::BARCODE_SIZE
);
$usableHeight -= self::BARCODE_SIZE + self::BARCODE_MARGIN;
}
if ($record->has('logo')) {
$logoSize = static::writeImage(
$pdf, $record->get('logo'),
$pa->x1, $pa->y1,
self::LOGO_MAX_WIDTH, $usableHeight,
'L', 'T', 300, true, false, 0.1
);
$currentX += $logoSize[0] + self::LOGO_MARGIN;
$usableWidth -= $logoSize[0] + self::LOGO_MARGIN;
}
if ($record->has('title')) {
static::writeText(
$pdf, $record->get('title'),
$currentX, $currentY,
'freesans', '', self::TITLE_SIZE, 'L',
$usableWidth, self::TITLE_SIZE, true, 0
);
$currentY += self::TITLE_SIZE + self::TITLE_MARGIN;
}
foreach ($record->get('fields') as $field) {
static::writeText(
$pdf, $field['label'],
$currentX, $currentY,
'freesans', '', self::LABEL_SIZE, 'L',
$usableWidth, self::LABEL_SIZE, true, 0
);
$currentY += self::LABEL_SIZE + self::LABEL_MARGIN;
static::writeText(
$pdf, $field['value'],
$currentX, $currentY,
'freemono', 'B', self::FIELD_SIZE, 'L',
$usableWidth, self::FIELD_SIZE, true, 0, 0.3
);
$currentY += self::FIELD_SIZE + self::FIELD_MARGIN;
}
static::writeText(
$pdf, $record->get('tag'),
$currentX, $pa->y2 - self::BARCODE_SIZE - self::BARCODE_MARGIN - self::TAG_SIZE,
'freemono', 'b', self::TAG_SIZE, 'R',
$usableWidth, self::TAG_SIZE, true, 0, 0.3
);
}
}
?>

View file

@ -0,0 +1,71 @@
<?php
namespace App\Models\Labels\Sheets\Avery;
use App\Helpers\Helper;
use App\Models\Labels\RectangleSheet;
abstract class L7163 extends RectangleSheet
{
private const PAPER_FORMAT = 'A4';
private const PAPER_ORIENTATION = 'P';
/* Data in pt from Word Template */
private const COLUMN1_X = 13.25;
private const COLUMN2_X = 301.25;
private const ROW1_Y = 43.05;
private const ROW2_Y = 151.05;
private const LABEL_W = 280.80;
private const LABEL_H = 108.00;
private float $pageWidth;
private float $pageHeight;
private float $pageMarginLeft;
private float $pageMarginTop;
private float $columnSpacing;
private float $rowSpacing;
private float $labelWidth;
private float $labelHeight;
public function __construct() {
$paperSize = static::fromFormat(self::PAPER_FORMAT, self::PAPER_ORIENTATION, $this->getUnit(), 0);
$this->pageWidth = $paperSize->width;
$this->pageHeight = $paperSize->height;
$this->pageMarginLeft = Helper::convertUnit(self::COLUMN1_X, 'pt', $this->getUnit());
$this->pageMarginTop = Helper::convertUnit(self::ROW1_Y, 'pt', $this->getUnit());
$columnSpacingPt = self::COLUMN2_X - self::COLUMN1_X - self::LABEL_W;
$this->columnSpacing = Helper::convertUnit($columnSpacingPt, 'pt', $this->getUnit());
$rowSpacingPt = self::ROW2_Y - self::ROW1_Y - self::LABEL_H;
$this->rowSpacing = Helper::convertUnit($rowSpacingPt, 'pt', $this->getUnit());
$this->labelWidth = Helper::convertUnit(self::LABEL_W, 'pt', $this->getUnit());
$this->labelHeight = Helper::convertUnit(self::LABEL_H, 'pt', $this->getUnit());
}
public function getPageWidth() { return $this->pageWidth; }
public function getPageHeight() { return $this->pageHeight; }
public function getPageMarginTop() { return $this->pageMarginTop; }
public function getPageMarginBottom() { return $this->pageMarginTop; }
public function getPageMarginLeft() { return $this->pageMarginLeft; }
public function getPageMarginRight() { return $this->pageMarginLeft; }
public function getColumns() { return 2; }
public function getRows() { return 7; }
public function getLabelColumnSpacing() { return $this->columnSpacing; }
public function getLabelRowSpacing() { return $this->rowSpacing; }
public function getLabelWidth() { return $this->labelWidth; }
public function getLabelHeight() { return $this->labelHeight; }
public function getLabelBorder() { return 0; }
}
?>

View file

@ -0,0 +1,98 @@
<?php
namespace App\Models\Labels\Sheets\Avery;
class L7163_A extends L7163
{
private const BARCODE_MARGIN = 1.80;
private const TAG_SIZE = 4.80;
private const TITLE_SIZE = 5.00;
private const TITLE_MARGIN = 1.80;
private const LABEL_SIZE = 2.35;
private const LABEL_MARGIN = - 0.30;
private const FIELD_SIZE = 4.80;
private const FIELD_MARGIN = 0.30;
public function getUnit() { return 'mm'; }
public function getLabelMarginTop() { return 1.0; }
public function getLabelMarginBottom() { return 1.0; }
public function getLabelMarginLeft() { return 1.0; }
public function getLabelMarginRight() { return 1.0; }
public function getSupportAssetTag() { return true; }
public function getSupport1DBarcode() { return false; }
public function getSupport2DBarcode() { return true; }
public function getSupportFields() { return 4; }
public function getSupportLogo() { return false; }
public function getSupportTitle() { return true; }
public function preparePDF($pdf) {}
public function write($pdf, $record) {
$pa = $this->getLabelPrintableArea();
$usableWidth = $pa->w;
$usableHeight = $pa->h;
$currentX = $pa->x1;
$currentY = $pa->y1;
if ($record->has('title')) {
static::writeText(
$pdf, $record->get('title'),
$currentX, $currentY,
'freesans', '', self::TITLE_SIZE, 'C',
$usableWidth, self::TITLE_SIZE, true, 0
);
$currentY += self::TITLE_SIZE + self::TITLE_MARGIN;
}
$barcodeSize = $pa->h - self::TITLE_SIZE - self::TITLE_MARGIN - self::TAG_SIZE;
if ($record->has('barcode2d')) {
static::writeText(
$pdf, $record->get('tag'),
$pa->x1, $pa->y2 - self::TAG_SIZE,
'freemono', 'b', self::TAG_SIZE, 'C',
$barcodeSize, self::TAG_SIZE, true, 0
);
static::write2DBarcode(
$pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type,
$pa->x1, $currentY,
$barcodeSize, $barcodeSize
);
$currentX += $barcodeSize + self::BARCODE_MARGIN;
$usableWidth -= $barcodeSize + self::BARCODE_MARGIN;
} else {
static::writeText(
$pdf, $record->get('tag'),
$pa->x1, $pa->y2 - self::TAG_SIZE,
'freemono', 'b', self::TAG_SIZE, 'R',
$usableWidth, self::TAG_SIZE, true, 0
);
}
foreach ($record->get('fields') as $field) {
static::writeText(
$pdf, $field['label'],
$currentX, $currentY,
'freesans', '', self::LABEL_SIZE, 'L',
$usableWidth, self::LABEL_SIZE, true, 0
);
$currentY += self::LABEL_SIZE + self::LABEL_MARGIN;
static::writeText(
$pdf, $field['value'],
$currentX, $currentY,
'freemono', 'B', self::FIELD_SIZE, 'L',
$usableWidth, self::FIELD_SIZE, true, 0, 0.5
);
$currentY += self::FIELD_SIZE + self::FIELD_MARGIN;
}
}
}
?>

View file

@ -0,0 +1,71 @@
<?php
namespace App\Models\Labels\Sheets\Avery;
use App\Helpers\Helper;
use App\Models\Labels\RectangleSheet;
abstract class _5267 extends RectangleSheet
{
private const PAPER_FORMAT = 'LETTER';
private const PAPER_ORIENTATION = 'P';
/* Data in pt from Word Template */
private const COLUMN1_X = 21.60;
private const COLUMN2_X = 169.20;
private const ROW1_Y = 36.10;
private const ROW2_Y = 72.10;
private const LABEL_W = 126.00;
private const LABEL_H = 36.00;
private float $pageWidth;
private float $pageHeight;
private float $pageMarginLeft;
private float $pageMarginTop;
private float $columnSpacing;
private float $rowSpacing;
private float $labelWidth;
private float $labelHeight;
public function __construct() {
$paperSize = static::fromFormat(self::PAPER_FORMAT, self::PAPER_ORIENTATION, $this->getUnit(), 2);
$this->pageWidth = $paperSize->width;
$this->pageHeight = $paperSize->height;
$this->pageMarginLeft = Helper::convertUnit(self::COLUMN1_X, 'pt', $this->getUnit());
$this->pageMarginTop = Helper::convertUnit(self::ROW1_Y, 'pt', $this->getUnit());
$columnSpacingPt = self::COLUMN2_X - self::COLUMN1_X - self::LABEL_W;
$this->columnSpacing = Helper::convertUnit($columnSpacingPt, 'pt', $this->getUnit());
$rowSpacingPt = self::ROW2_Y - self::ROW1_Y - self::LABEL_H;
$this->rowSpacing = Helper::convertUnit($rowSpacingPt, 'pt', $this->getUnit());
$this->labelWidth = Helper::convertUnit(self::LABEL_W, 'pt', $this->getUnit());
$this->labelHeight = Helper::convertUnit(self::LABEL_H, 'pt', $this->getUnit());
}
public function getPageWidth() { return $this->pageWidth; }
public function getPageHeight() { return $this->pageHeight; }
public function getPageMarginTop() { return $this->pageMarginTop; }
public function getPageMarginBottom() { return $this->pageMarginTop; }
public function getPageMarginLeft() { return $this->pageMarginLeft; }
public function getPageMarginRight() { return $this->pageMarginLeft; }
public function getColumns() { return 4; }
public function getRows() { return 20; }
public function getLabelColumnSpacing() { return $this->columnSpacing; }
public function getLabelRowSpacing() { return $this->rowSpacing; }
public function getLabelWidth() { return $this->labelWidth; }
public function getLabelHeight() { return $this->labelHeight; }
public function getLabelBorder() { return 0; }
}
?>

View file

@ -0,0 +1,68 @@
<?php
namespace App\Models\Labels\Sheets\Avery;
class _5267_A extends _5267
{
private const BARCODE_SIZE = 0.175;
private const BARCODE_MARGIN = 0.000;
private const TAG_SIZE = 0.125;
private const TITLE_SIZE = 0.140;
private const FIELD_SIZE = 0.150;
private const FIELD_MARGIN = 0.012;
public function getUnit() { return 'in'; }
public function getLabelMarginTop() { return 0.02; }
public function getLabelMarginBottom() { return 0.00; }
public function getLabelMarginLeft() { return 0.04; }
public function getLabelMarginRight() { return 0.04; }
public function getSupportAssetTag() { return false; }
public function getSupport1DBarcode() { return true; }
public function getSupport2DBarcode() { return false; }
public function getSupportFields() { return 1; }
public function getSupportLogo() { return false; }
public function getSupportTitle() { return true; }
public function preparePDF($pdf) {}
public function write($pdf, $record) {
$pa = $this->getLabelPrintableArea();
if ($record->has('barcode1d')) {
static::write1DBarcode(
$pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type,
$pa->x1, $pa->y2 - self::BARCODE_SIZE,
$pa->w, self::BARCODE_SIZE
);
}
if ($record->has('title')) {
static::writeText(
$pdf, $record->get('title'),
$pa->x1, $pa->y1,
'freesans', '', self::TITLE_SIZE, 'L',
$pa->w, self::TITLE_SIZE, true, 0
);
}
$fieldY = $pa->y2 - self::BARCODE_SIZE - self::BARCODE_MARGIN - self::FIELD_SIZE;
if ($record->has('fields')) {
if ($record->get('fields')->count() >= 1) {
$field = $record->get('fields')->first();
static::writeText(
$pdf, $field['value'],
$pa->x1, $fieldY,
'freemono', 'B', self::FIELD_SIZE, 'C',
$pa->w, self::FIELD_SIZE, true, 0, 0.01
);
}
}
}
}
?>

View file

@ -0,0 +1,71 @@
<?php
namespace App\Models\Labels\Sheets\Avery;
use App\Helpers\Helper;
use App\Models\Labels\RectangleSheet;
abstract class _5520 extends RectangleSheet
{
private const PAPER_FORMAT = 'LETTER';
private const PAPER_ORIENTATION = 'P';
/* Data in pt from Word Template */
private const COLUMN1_X = 13.55;
private const COLUMN2_X = 211.55;
private const ROW1_Y = 36.10;
private const ROW2_Y = 108.10;
private const LABEL_W = 189.35;
private const LABEL_H = 72.00;
private float $pageWidth;
private float $pageHeight;
private float $pageMarginLeft;
private float $pageMarginTop;
private float $columnSpacing;
private float $rowSpacing;
private float $labelWidth;
private float $labelHeight;
public function __construct() {
$paperSize = static::fromFormat(self::PAPER_FORMAT, self::PAPER_ORIENTATION, $this->getUnit(), 2);
$this->pageWidth = $paperSize->width;
$this->pageHeight = $paperSize->height;
$this->pageMarginLeft = Helper::convertUnit(self::COLUMN1_X, 'pt', $this->getUnit());
$this->pageMarginTop = Helper::convertUnit(self::ROW1_Y, 'pt', $this->getUnit());
$columnSpacingPt = self::COLUMN2_X - self::COLUMN1_X - self::LABEL_W;
$this->columnSpacing = Helper::convertUnit($columnSpacingPt, 'pt', $this->getUnit());
$rowSpacingPt = self::ROW2_Y - self::ROW1_Y - self::LABEL_H;
$this->rowSpacing = Helper::convertUnit($rowSpacingPt, 'pt', $this->getUnit());
$this->labelWidth = Helper::convertUnit(self::LABEL_W, 'pt', $this->getUnit());
$this->labelHeight = Helper::convertUnit(self::LABEL_H, 'pt', $this->getUnit());
}
public function getPageWidth() { return $this->pageWidth; }
public function getPageHeight() { return $this->pageHeight; }
public function getPageMarginTop() { return $this->pageMarginTop; }
public function getPageMarginBottom() { return $this->pageMarginTop; }
public function getPageMarginLeft() { return $this->pageMarginLeft; }
public function getPageMarginRight() { return $this->pageMarginLeft; }
public function getColumns() { return 3; }
public function getRows() { return 10; }
public function getLabelColumnSpacing() { return $this->columnSpacing; }
public function getLabelRowSpacing() { return $this->rowSpacing; }
public function getLabelWidth() { return $this->labelWidth; }
public function getLabelHeight() { return $this->labelHeight; }
public function getLabelBorder() { return 0; }
}
?>

View file

@ -0,0 +1,85 @@
<?php
namespace App\Models\Labels\Sheets\Avery;
class _5520_A extends _5520
{
private const BARCODE_MARGIN = 0.075;
private const TAG_SIZE = 0.125;
private const TITLE_SIZE = 0.140;
private const TITLE_MARGIN = 0.040;
private const LABEL_SIZE = 0.090;
private const LABEL_MARGIN = -0.015;
private const FIELD_SIZE = 0.150;
private const FIELD_MARGIN = 0.012;
public function getUnit() { return 'in'; }
public function getLabelMarginTop() { return 0.06; }
public function getLabelMarginBottom() { return 0.06; }
public function getLabelMarginLeft() { return 0.06; }
public function getLabelMarginRight() { return 0.06; }
public function getSupportAssetTag() { return false; }
public function getSupport1DBarcode() { return false; }
public function getSupport2DBarcode() { return true; }
public function getSupportFields() { return 3; }
public function getSupportLogo() { return false; }
public function getSupportTitle() { return true; }
public function preparePDF($pdf) {}
public function write($pdf, $record) {
$pa = $this->getLabelPrintableArea();
$currentX = $pa->x1;
$currentY = $pa->y1;
$usableWidth = $pa->w;
$usableHeight = $pa->h;
if ($record->has('title')) {
static::writeText(
$pdf, $record->get('title'),
$pa->x1, $pa->y1,
'freesans', '', self::TITLE_SIZE, 'C',
$pa->w, self::TITLE_SIZE, true, 0
);
$currentY += self::TITLE_SIZE + self::TITLE_MARGIN;
$usableHeight -= self::TITLE_SIZE + self::TITLE_MARGIN;
}
$barcodeSize = $usableHeight;
if ($record->has('barcode2d')) {
static::write2DBarcode(
$pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type,
$currentX, $currentY,
$barcodeSize, $barcodeSize
);
$currentX += $barcodeSize + self::BARCODE_MARGIN;
$usableWidth -= $barcodeSize + self::BARCODE_MARGIN;
}
foreach ($record->get('fields') as $field) {
static::writeText(
$pdf, $field['label'],
$currentX, $currentY,
'freesans', '', self::LABEL_SIZE, 'L',
$usableWidth, self::LABEL_SIZE, true, 0
);
$currentY += self::LABEL_SIZE + self::LABEL_MARGIN;
static::writeText(
$pdf, $field['value'],
$currentX, $currentY,
'freemono', 'B', self::FIELD_SIZE, 'L',
$usableWidth, self::FIELD_SIZE, true, 0, 0.01
);
$currentY += self::FIELD_SIZE + self::FIELD_MARGIN;
}
}
}
?>

View file

@ -0,0 +1,19 @@
<?php
namespace App\Models\Labels\Tapes\Brother;
use App\Helpers\Helper;
use App\Models\Labels\Label;
abstract class TZe_12mm extends Label
{
private const HEIGHT = 12.00;
private const MARGIN_SIDES = 3.20;
private const MARGIN_ENDS = 3.20;
public function getHeight() { return Helper::convertUnit(self::HEIGHT, 'mm', $this->getUnit()); }
public function getMarginTop() { return Helper::convertUnit(self::MARGIN_SIDES, 'mm', $this->getUnit()); }
public function getMarginBottom() { return Helper::convertUnit(self::MARGIN_SIDES, 'mm', $this->getUnit());}
public function getMarginLeft() { return Helper::convertUnit(self::MARGIN_ENDS, 'mm', $this->getUnit()); }
public function getMarginRight() { return Helper::convertUnit(self::MARGIN_ENDS, 'mm', $this->getUnit()); }
}

View file

@ -0,0 +1,56 @@
<?php
namespace App\Models\Labels\Tapes\Brother;
class TZe_12mm_A extends TZe_12mm
{
private const BARCODE_SIZE = 3.20;
private const BARCODE_MARGIN = 0.30;
private const TEXT_SIZE_MOD = 1.00;
public function getUnit() { return 'mm'; }
public function getWidth() { return 50.0; }
public function getSupportAssetTag() { return true; }
public function getSupport1DBarcode() { return true; }
public function getSupport2DBarcode() { return false; }
public function getSupportFields() { return 1; }
public function getSupportLogo() { return false; }
public function getSupportTitle() { return false; }
public function preparePDF($pdf) {}
public function write($pdf, $record) {
$pa = $this->getPrintableArea();
if ($record->has('barcode1d')) {
static::write1DBarcode(
$pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type,
$pa->x1, $pa->y1, $pa->w, self::BARCODE_SIZE
);
}
$currentY = $pa->y1 + self::BARCODE_SIZE + self::BARCODE_MARGIN;
$usableHeight = $pa->h - self::BARCODE_SIZE - self::BARCODE_MARGIN;
$fontSize = $usableHeight + self::TEXT_SIZE_MOD;
$tagWidth = $pa->w / 3;
$fieldWidth = $pa->w / 3 * 2;
static::writeText(
$pdf, $record->get('tag'),
$pa->x1, $currentY,
'freemono', 'b', $fontSize, 'L',
$tagWidth, $usableHeight, true, 0, 0
);
if ($record->get('fields')->count() >= 1) {
static::writeText(
$pdf, $record->get('fields')->values()->get(0)['value'],
$pa->x1 + ($tagWidth), $currentY,
'freemono', 'b', $fontSize, 'R',
$fieldWidth, $usableHeight, true, 0, 0
);
}
}
}

View file

@ -0,0 +1,19 @@
<?php
namespace App\Models\Labels\Tapes\Brother;
use App\Helpers\Helper;
use App\Models\Labels\Label;
abstract class TZe_24mm extends Label
{
private const HEIGHT = 24.00;
private const MARGIN_SIDES = 3.20;
private const MARGIN_ENDS = 3.20;
public function getHeight() { return Helper::convertUnit(self::HEIGHT, 'mm', $this->getUnit()); }
public function getMarginTop() { return Helper::convertUnit(self::MARGIN_SIDES, 'mm', $this->getUnit()); }
public function getMarginBottom() { return Helper::convertUnit(self::MARGIN_SIDES, 'mm', $this->getUnit());}
public function getMarginLeft() { return Helper::convertUnit(self::MARGIN_ENDS, 'mm', $this->getUnit()); }
public function getMarginRight() { return Helper::convertUnit(self::MARGIN_ENDS, 'mm', $this->getUnit()); }
}

View file

@ -0,0 +1,87 @@
<?php
namespace App\Models\Labels\Tapes\Brother;
class TZe_24mm_A extends TZe_24mm
{
private const BARCODE_MARGIN = 1.40;
private const TAG_SIZE = 2.80;
private const TITLE_SIZE = 2.80;
private const TITLE_MARGIN = 0.50;
private const LABEL_SIZE = 2.00;
private const LABEL_MARGIN = - 0.35;
private const FIELD_SIZE = 3.20;
private const FIELD_MARGIN = 0.15;
public function getUnit() { return 'mm'; }
public function getWidth() { return 65.0; }
public function getSupportAssetTag() { return true; }
public function getSupport1DBarcode() { return false; }
public function getSupport2DBarcode() { return true; }
public function getSupportFields() { return 3; }
public function getSupportLogo() { return false; }
public function getSupportTitle() { return true; }
public function preparePDF($pdf) {}
public function write($pdf, $record) {
$pa = $this->getPrintableArea();
$currentX = $pa->x1;
$currentY = $pa->y1;
$usableWidth = $pa->w;
$barcodeSize = $pa->h - self::TAG_SIZE;
if ($record->has('barcode2d')) {
static::writeText(
$pdf, $record->get('tag'),
$pa->x1, $pa->y2 - self::TAG_SIZE,
'freemono', 'b', self::TAG_SIZE, 'C',
$barcodeSize, self::TAG_SIZE, true, 0
);
static::write2DBarcode(
$pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type,
$currentX, $currentY,
$barcodeSize, $barcodeSize
);
$currentX += $barcodeSize + self::BARCODE_MARGIN;
$usableWidth -= $barcodeSize + self::BARCODE_MARGIN;
} else {
static::writeText(
$pdf, $record->get('tag'),
$pa->x1, $pa->y2 - self::TAG_SIZE,
'freemono', 'b', self::TAG_SIZE, 'R',
$usableWidth, self::TAG_SIZE, true, 0
);
}
if ($record->has('title')) {
static::writeText(
$pdf, $record->get('title'),
$currentX, $currentY,
'freesans', '', self::TITLE_SIZE, 'L',
$usableWidth, self::TITLE_SIZE, true, 0
);
$currentY += self::TITLE_SIZE + self::TITLE_MARGIN;
}
foreach ($record->get('fields') as $field) {
static::writeText(
$pdf, $field['label'],
$currentX, $currentY,
'freesans', '', self::LABEL_SIZE, 'L',
$usableWidth, self::LABEL_SIZE, true, 0, 0
);
$currentY += self::LABEL_SIZE + self::LABEL_MARGIN;
static::writeText(
$pdf, $field['value'],
$currentX, $currentY,
'freemono', 'B', self::FIELD_SIZE, 'L',
$usableWidth, self::FIELD_SIZE, true, 0, 0.3
);
$currentY += self::FIELD_SIZE + self::FIELD_MARGIN;
}
}
}

View file

@ -45,6 +45,14 @@ class CompanyPresenter extends Presenter
'title' => trans('admin/suppliers/table.fax'),
'visible' => false,
'formatter' => 'phoneFormatter',
], [
'field' => 'email',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/suppliers/table.email'),
'visible' => true,
'formatter' => 'emailFormatter',
], [
'field' => 'image',
'searchable' => false,

View file

@ -0,0 +1,96 @@
<?php
namespace App\Presenters;
/**
* Class LabelPresenter
*/
class LabelPresenter extends Presenter
{
/**
* Json Column Layout for bootstrap table
* @return string
*/
public static function dataTableLayout()
{
$layout = [
[
'field' => 'radio',
'radio' => true,
'formatter' => 'labelRadioFormatter'
], [
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.name'),
'visible' => true,
], [
'field' => 'size',
'searchable' => false,
'sortable' => false,
'switchable' => true,
'title' => trans('admin/settings/table.size'),
'visible' => true,
'formatter' => 'labelSizeFormatter'
], [
'field' => 'labels_per_page',
'searchable' => false,
'sortable' => false,
'switchable' => true,
'title' => trans('admin/labels/table.labels_per_page'),
'visible' => true,
'formatter' => 'labelPerPageFormatter'
], [
'field' => 'support_fields',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/labels/table.support_fields'),
'visible' => true
], [
'field' => 'support_asset_tag',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/labels/table.support_asset_tag'),
'visible' => true,
'formatter' => 'trueFalseFormatter'
], [
'field' => 'support_1d_barcode',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/labels/table.support_1d_barcode'),
'visible' => true,
'formatter' => 'trueFalseFormatter'
], [
'field' => 'support_2d_barcode',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/labels/table.support_2d_barcode'),
'visible' => true,
'formatter' => 'trueFalseFormatter'
], [
'field' => 'support_logo',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/labels/table.support_logo'),
'visible' => true,
'formatter' => 'trueFalseFormatter'
], [
'field' => 'support_title',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/labels/table.support_title'),
'visible' => true,
'formatter' => 'trueFalseFormatter'
]
];
return json_encode($layout);
}
}

211
app/View/Label.php Normal file
View file

@ -0,0 +1,211 @@
<?php
namespace App\View;
use App\Models\Labels\Field;
use App\Models\Labels\Label as LabelModel;
use App\Models\Labels\Sheet;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Traits\Macroable;
use TCPDF;
class Label implements View
{
use Macroable { __call as macroCall; }
protected const NAME = 'label';
/**
* A Collection of passed data.
*
* @var Collection
*/
protected $data;
public function __construct() {
$this->data = new Collection();
}
/**
* Render the PDF label.
*
* @param callable|null $callback
*/
public function render(callable $callback = null)
{
$settings = $this->data->get('settings');
$assets = $this->data->get('assets');
$offset = $this->data->get('offset');
$template = $this->data->get('template');
// If disabled, pass to legacy view
if ((!$settings->label2_enable) && (!$template)) {
return view('hardware/labels')
->with('assets', $assets)
->with('settings', $settings)
->with('bulkedit', $this->data->get('bulkedit'))
->with('count', $this->data->get('count'));
}
if (empty($template)) $template = LabelModel::find($settings->label2_template);
elseif (is_string($template)) $template = LabelModel::find($template);
$template->validate();
$pdf = new TCPDF(
$template->getOrientation(),
$template->getUnit(),
[ $template->getWidth(), $template->getHeight() ]
);
// Reset parameters
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->SetAutoPageBreak(false);
$pdf->SetMargins(0, 0, null, true);
$pdf->SetCellMargins(0, 0, 0, 0);
$pdf->SetCellPaddings(0, 0, 0, 0);
$pdf->setCreator('Snipe-IT');
$pdf->SetSubject('Asset Labels');
$template->preparePDF($pdf);
// Get fields from settings
$fieldDefinitions = collect(explode(';', $settings->label2_fields))
->filter(fn($fieldString) => !empty($fieldString))
->map(fn($fieldString) => Field::fromString($fieldString));
// Prepare data
$data = $assets
->map(function ($asset) use ($template, $settings, $fieldDefinitions) {
$assetData = new Collection();
$assetData->put('asset', $asset);
$assetData->put('id', $asset->id);
$assetData->put('tag', $asset->asset_tag);
if ($template->getSupportTitle()) {
$title = !empty($settings->label2_title) ?
str_ireplace('{COMPANY}', $asset->company->name, $settings->label2_title) :
$settings->qr_text;
if (!empty($title)) $assetData->put('title', $title);
}
if ($template->getSupportLogo()) {
$logo = $settings->label2_asset_logo ?
(
!empty($asset->company->image) ?
Storage::disk('public')->path('companies/'.e($asset->company->image)) :
null
) :
(
!empty($settings->label_logo) ?
Storage::disk('public')->path(''.e($settings->label_logo)) :
null
);
if (!empty($logo)) $assetData->put('logo', $logo);
}
if ($template->getSupport1DBarcode()) {
$barcode1DType = $settings->label2_1d_type;
$barcode1DType = ($barcode1DType == 'default') ?
(($settings->alt_barcode_enabled) ? $settings->alt_barcode : null) :
$barcode1DType;
if ($barcode1DType != 'none') {
$assetData->put('barcode1d', (object)[
'type' => $barcode1DType,
'content' => $asset->asset_tag,
]);
}
}
if ($template->getSupport2DBarcode()) {
$barcode2DType = $settings->label2_2d_type;
$barcode2DType = ($barcode2DType == 'default') ?
$settings->barcode_type :
$barcode2DType;
if (($barcode2DType != 'none') && (!is_null($barcode2DType))) {
switch ($settings->label2_2d_target) {
case 'ht_tag': $barcode2DTarget = route('ht/assetTag', $asset->asset_tag); break;
case 'hardware_id':
default: $barcode2DTarget = route('hardware.show', $asset->id); break;
}
$assetData->put('barcode2d', (object)[
'type' => $barcode2DType,
'content' => $barcode2DTarget,
]);
}
}
$fields = $fieldDefinitions
->map(fn($field) => $field->toArray($asset))
->filter(fn($field) => $field != null)
->reduce(function($myFields, $field) {
// Remove Duplicates
$toAdd = $field
->filter(fn($o) => !$myFields->contains('dataSource', $o['dataSource']))
->first();
return $toAdd ? $myFields->push($toAdd) : $myFields;
}, new Collection());
$assetData->put('fields', $fields->take($template->getSupportFields()));
return $assetData;
});
if ($template instanceof Sheet) {
$template->setLabelIndexOffset($offset ?? 0);
}
$template->writeAll($pdf, $data);
$filename = $assets->count() > 1 ? 'assets.pdf' : $assets->first()->asset_tag.'.pdf';
$pdf->Output($filename, 'I');
}
/**
* Add a piece of data.
*
* @param string|array $key
* @param mixed $value
* @return $this
*/
public function with($key, $value = null)
{
$this->data->put($key, $value);
return $this;
}
/**
* Get the array of view data.
*
* @return array
*/
public function getData()
{
return $this->data;
}
/**
* Get the name of the view.
*
* @return string
*/
public function name()
{
return $this->getName();
}
/**
* Get the name of the view.
*
* @return string
*/
public function getName()
{
return self::NAME;
}
}

View file

@ -57,6 +57,7 @@
"rollbar/rollbar-laravel": "^8.0",
"spatie/laravel-backup": "^8.0",
"tecnickcom/tc-lib-barcode": "^1.15",
"tecnickcom/tcpdf": "^6.5",
"unicodeveloper/laravel-password": "^1.0",
"watson/validating": "^8.1"
},

430
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "13b994417396cd9249640d9dfce1b394",
"content-hash": "7ae0b408bfe4312a67752d97db504e3b",
"packages": [
{
"name": "alek13/slack",
@ -188,16 +188,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.277.4",
"version": "3.278.3",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "9f36e76a3e1f8c7eba8cacbfa1d5f1257cd04241"
"reference": "596534c0627d8b38597061341e99b460437d1a16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/9f36e76a3e1f8c7eba8cacbfa1d5f1257cd04241",
"reference": "9f36e76a3e1f8c7eba8cacbfa1d5f1257cd04241",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/596534c0627d8b38597061341e99b460437d1a16",
"reference": "596534c0627d8b38597061341e99b460437d1a16",
"shasum": ""
},
"require": {
@ -277,9 +277,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.277.4"
"source": "https://github.com/aws/aws-sdk-php/tree/3.278.3"
},
"time": "2023-07-28T22:10:53+00:00"
"time": "2023-08-15T18:07:55+00:00"
},
{
"name": "bacon/bacon-qr-code",
@ -337,16 +337,16 @@
},
{
"name": "barryvdh/laravel-debugbar",
"version": "v3.8.1",
"version": "v3.8.2",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-debugbar.git",
"reference": "aff3235fecb4104203b1e62c32239c56530eee32"
"reference": "56a2dc1da9d3219164074713983eef68996386cf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/aff3235fecb4104203b1e62c32239c56530eee32",
"reference": "aff3235fecb4104203b1e62c32239c56530eee32",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/56a2dc1da9d3219164074713983eef68996386cf",
"reference": "56a2dc1da9d3219164074713983eef68996386cf",
"shasum": ""
},
"require": {
@ -405,7 +405,7 @@
],
"support": {
"issues": "https://github.com/barryvdh/laravel-debugbar/issues",
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.8.1"
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.8.2"
},
"funding": [
{
@ -417,7 +417,7 @@
"type": "github"
}
],
"time": "2023-02-21T14:21:02+00:00"
"time": "2023-07-26T04:57:49+00:00"
},
{
"name": "barryvdh/laravel-dompdf",
@ -1394,16 +1394,16 @@
},
{
"name": "dragonmantank/cron-expression",
"version": "v3.3.2",
"version": "v3.3.3",
"source": {
"type": "git",
"url": "https://github.com/dragonmantank/cron-expression.git",
"reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8"
"reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8",
"reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8",
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/adfb1f505deb6384dc8b39804c5065dd3c8c8c0a",
"reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a",
"shasum": ""
},
"require": {
@ -1443,7 +1443,7 @@
],
"support": {
"issues": "https://github.com/dragonmantank/cron-expression/issues",
"source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2"
"source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.3"
},
"funding": [
{
@ -1451,7 +1451,7 @@
"type": "github"
}
],
"time": "2022-09-10T18:51:20+00:00"
"time": "2023-08-10T19:36:49+00:00"
},
{
"name": "eduardokum/laravel-mail-auto-embed",
@ -2158,16 +2158,16 @@
},
{
"name": "guzzlehttp/psr7",
"version": "2.5.0",
"version": "2.6.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "b635f279edd83fc275f822a1188157ffea568ff6"
"reference": "8bd7c33a0734ae1c5d074360512beb716bef3f77"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6",
"reference": "b635f279edd83fc275f822a1188157ffea568ff6",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/8bd7c33a0734ae1c5d074360512beb716bef3f77",
"reference": "8bd7c33a0734ae1c5d074360512beb716bef3f77",
"shasum": ""
},
"require": {
@ -2254,7 +2254,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.5.0"
"source": "https://github.com/guzzle/psr7/tree/2.6.0"
},
"funding": [
{
@ -2270,7 +2270,7 @@
"type": "tidelift"
}
],
"time": "2023-04-17T16:11:26+00:00"
"time": "2023-08-03T15:06:02+00:00"
},
{
"name": "guzzlehttp/uri-template",
@ -2476,16 +2476,16 @@
},
{
"name": "laravel/framework",
"version": "v10.16.1",
"version": "v10.19.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "5c93d2795c393b462481179ce42dedfb30cc19b5"
"reference": "b8557e4a708a1bd2bc8229bd53feecfa2ac1c6fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/5c93d2795c393b462481179ce42dedfb30cc19b5",
"reference": "5c93d2795c393b462481179ce42dedfb30cc19b5",
"url": "https://api.github.com/repos/laravel/framework/zipball/b8557e4a708a1bd2bc8229bd53feecfa2ac1c6fb",
"reference": "b8557e4a708a1bd2bc8229bd53feecfa2ac1c6fb",
"shasum": ""
},
"require": {
@ -2503,11 +2503,12 @@
"ext-tokenizer": "*",
"fruitcake/php-cors": "^1.2",
"guzzlehttp/uri-template": "^1.0",
"laravel/prompts": "^0.1",
"laravel/serializable-closure": "^1.3",
"league/commonmark": "^2.2.1",
"league/flysystem": "^3.8.0",
"monolog/monolog": "^3.0",
"nesbot/carbon": "^2.62.1",
"nesbot/carbon": "^2.67",
"nunomaduro/termwind": "^1.13",
"php": "^8.1",
"psr/container": "^1.1.1|^2.0.1",
@ -2586,7 +2587,6 @@
"mockery/mockery": "^1.5.1",
"orchestra/testbench-core": "^8.4",
"pda/pheanstalk": "^4.0",
"phpstan/phpdoc-parser": "^1.15",
"phpstan/phpstan": "^1.4.7",
"phpunit/phpunit": "^10.0.7",
"predis/predis": "^2.0.2",
@ -2672,7 +2672,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2023-07-26T03:30:46+00:00"
"time": "2023-08-15T13:42:57+00:00"
},
{
"name": "laravel/helpers",
@ -2808,6 +2808,54 @@
},
"time": "2023-07-07T06:37:11+00:00"
},
{
"name": "laravel/prompts",
"version": "v0.1.5",
"source": {
"type": "git",
"url": "https://github.com/laravel/prompts.git",
"reference": "d880a909df144a4bf5760ebd09aba114f79d9adc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/prompts/zipball/d880a909df144a4bf5760ebd09aba114f79d9adc",
"reference": "d880a909df144a4bf5760ebd09aba114f79d9adc",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"illuminate/collections": "^10.0|^11.0",
"php": "^8.1",
"symfony/console": "^6.2"
},
"require-dev": {
"mockery/mockery": "^1.5",
"pestphp/pest": "^2.3",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-mockery": "^1.1"
},
"suggest": {
"ext-pcntl": "Required for the spinner to be animated."
},
"type": "library",
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Laravel\\Prompts\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"support": {
"issues": "https://github.com/laravel/prompts/issues",
"source": "https://github.com/laravel/prompts/tree/v0.1.5"
},
"time": "2023-08-15T14:29:44+00:00"
},
{
"name": "laravel/serializable-closure",
"version": "v1.3.1",
@ -3530,16 +3578,16 @@
},
{
"name": "league/csv",
"version": "9.9.0",
"version": "9.10.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/csv.git",
"reference": "b4418ede47fbd88facc34e40a16c8ce9153b961b"
"reference": "d24b0d484812313b07ab74b0fe4db9661606df6c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/csv/zipball/b4418ede47fbd88facc34e40a16c8ce9153b961b",
"reference": "b4418ede47fbd88facc34e40a16c8ce9153b961b",
"url": "https://api.github.com/repos/thephpleague/csv/zipball/d24b0d484812313b07ab74b0fe4db9661606df6c",
"reference": "d24b0d484812313b07ab74b0fe4db9661606df6c",
"shasum": ""
},
"require": {
@ -3548,16 +3596,17 @@
"php": "^8.1.2"
},
"require-dev": {
"doctrine/collections": "^2.1.2",
"doctrine/collections": "^2.1.3",
"ext-dom": "*",
"ext-xdebug": "*",
"friendsofphp/php-cs-fixer": "^v3.14.3",
"phpbench/phpbench": "^1.2.8",
"phpstan/phpstan": "^1.10.4",
"phpstan/phpstan-deprecation-rules": "^1.1.2",
"phpstan/phpstan-phpunit": "^1.3.10",
"phpstan/phpstan-strict-rules": "^1.5.0",
"phpunit/phpunit": "^10.0.14"
"friendsofphp/php-cs-fixer": "^v3.22.0",
"phpbench/phpbench": "^1.2.14",
"phpstan/phpstan": "^1.10.26",
"phpstan/phpstan-deprecation-rules": "^1.1.3",
"phpstan/phpstan-phpunit": "^1.3.13",
"phpstan/phpstan-strict-rules": "^1.5.1",
"phpunit/phpunit": "^10.3.1",
"symfony/var-dumper": "^6.3.3"
},
"suggest": {
"ext-dom": "Required to use the XMLConverter and the HTMLConverter classes",
@ -3613,7 +3662,7 @@
"type": "github"
}
],
"time": "2023-03-11T15:57:12+00:00"
"time": "2023-08-04T15:12:48+00:00"
},
{
"name": "league/event",
@ -3885,26 +3934,26 @@
},
{
"name": "league/mime-type-detection",
"version": "1.11.0",
"version": "1.13.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/mime-type-detection.git",
"reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd"
"reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd",
"reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/a6dfb1194a2946fcdc1f38219445234f65b35c96",
"reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"php": "^7.2 || ^8.0"
"php": "^7.4 || ^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.2",
"phpstan/phpstan": "^0.12.68",
"phpunit/phpunit": "^8.5.8 || ^9.3"
"phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0"
},
"type": "library",
"autoload": {
@ -3925,7 +3974,7 @@
"description": "Mime-type detection for Flysystem",
"support": {
"issues": "https://github.com/thephpleague/mime-type-detection/issues",
"source": "https://github.com/thephpleague/mime-type-detection/tree/1.11.0"
"source": "https://github.com/thephpleague/mime-type-detection/tree/1.13.0"
},
"funding": [
{
@ -3937,7 +3986,7 @@
"type": "tidelift"
}
],
"time": "2022-04-17T13:12:02+00:00"
"time": "2023-08-05T12:09:49+00:00"
},
{
"name": "league/oauth1-client",
@ -4276,16 +4325,16 @@
},
{
"name": "livewire/livewire",
"version": "v2.12.4",
"version": "v2.12.6",
"source": {
"type": "git",
"url": "https://github.com/livewire/livewire.git",
"reference": "cca62ce8f751279c36404886b74a02e6dd0110f2"
"reference": "7d3a57b3193299cf1a0639a3935c696f4da2cf92"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/livewire/livewire/zipball/cca62ce8f751279c36404886b74a02e6dd0110f2",
"reference": "cca62ce8f751279c36404886b74a02e6dd0110f2",
"url": "https://api.github.com/repos/livewire/livewire/zipball/7d3a57b3193299cf1a0639a3935c696f4da2cf92",
"reference": "7d3a57b3193299cf1a0639a3935c696f4da2cf92",
"shasum": ""
},
"require": {
@ -4337,7 +4386,7 @@
"description": "A front-end framework for Laravel.",
"support": {
"issues": "https://github.com/livewire/livewire/issues",
"source": "https://github.com/livewire/livewire/tree/v2.12.4"
"source": "https://github.com/livewire/livewire/tree/v2.12.6"
},
"funding": [
{
@ -4345,7 +4394,7 @@
"type": "github"
}
],
"time": "2023-07-28T20:46:24+00:00"
"time": "2023-08-11T04:02:34+00:00"
},
{
"name": "masterminds/html5",
@ -4787,21 +4836,21 @@
},
{
"name": "nette/schema",
"version": "v1.2.3",
"version": "v1.2.4",
"source": {
"type": "git",
"url": "https://github.com/nette/schema.git",
"reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f"
"reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f",
"reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f",
"url": "https://api.github.com/repos/nette/schema/zipball/c9ff517a53903b3d4e29ec547fb20feecb05b8ab",
"reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab",
"shasum": ""
},
"require": {
"nette/utils": "^2.5.7 || ^3.1.5 || ^4.0",
"php": ">=7.1 <8.3"
"php": "7.1 - 8.3"
},
"require-dev": {
"nette/tester": "^2.3 || ^2.4",
@ -4843,9 +4892,9 @@
],
"support": {
"issues": "https://github.com/nette/schema/issues",
"source": "https://github.com/nette/schema/tree/v1.2.3"
"source": "https://github.com/nette/schema/tree/v1.2.4"
},
"time": "2022-10-13T01:24:26+00:00"
"time": "2023-08-05T18:56:25+00:00"
},
{
"name": "nette/utils",
@ -4936,16 +4985,16 @@
},
{
"name": "nikic/php-parser",
"version": "v4.16.0",
"version": "v4.17.1",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "19526a33fb561ef417e822e85f08a00db4059c17"
"reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17",
"reference": "19526a33fb561ef417e822e85f08a00db4059c17",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d",
"reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d",
"shasum": ""
},
"require": {
@ -4986,9 +5035,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0"
"source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1"
},
"time": "2023-06-25T14:52:30+00:00"
"time": "2023-08-13T19:53:39+00:00"
},
{
"name": "nunomaduro/collision",
@ -5702,16 +5751,16 @@
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.7.2",
"version": "1.7.3",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "b2fe4d22a5426f38e014855322200b97b5362c0d"
"reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d",
"reference": "b2fe4d22a5426f38e014855322200b97b5362c0d",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419",
"reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419",
"shasum": ""
},
"require": {
@ -5754,9 +5803,9 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.2"
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3"
},
"time": "2023-05-30T18:13:47+00:00"
"time": "2023-08-12T11:01:26+00:00"
},
{
"name": "phpoption/phpoption",
@ -6013,16 +6062,16 @@
},
{
"name": "phpstan/phpdoc-parser",
"version": "1.23.0",
"version": "1.23.1",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "a2b24135c35852b348894320d47b3902a94bc494"
"reference": "846ae76eef31c6d7790fac9bc399ecee45160b26"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a2b24135c35852b348894320d47b3902a94bc494",
"reference": "a2b24135c35852b348894320d47b3902a94bc494",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26",
"reference": "846ae76eef31c6d7790fac9bc399ecee45160b26",
"shasum": ""
},
"require": {
@ -6054,9 +6103,9 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.0"
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1"
},
"time": "2023-07-23T22:17:56+00:00"
"time": "2023-08-03T16:32:59+00:00"
},
{
"name": "pragmarx/google2fa",
@ -6710,16 +6759,16 @@
},
{
"name": "psy/psysh",
"version": "v0.11.19",
"version": "v0.11.20",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
"reference": "1724ceff278daeeac5a006744633bacbb2dc4706"
"reference": "0fa27040553d1d280a67a4393194df5228afea5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/1724ceff278daeeac5a006744633bacbb2dc4706",
"reference": "1724ceff278daeeac5a006744633bacbb2dc4706",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/0fa27040553d1d280a67a4393194df5228afea5b",
"reference": "0fa27040553d1d280a67a4393194df5228afea5b",
"shasum": ""
},
"require": {
@ -6780,9 +6829,9 @@
],
"support": {
"issues": "https://github.com/bobthecow/psysh/issues",
"source": "https://github.com/bobthecow/psysh/tree/v0.11.19"
"source": "https://github.com/bobthecow/psysh/tree/v0.11.20"
},
"time": "2023-07-15T19:42:19+00:00"
"time": "2023-07-31T14:32:22+00:00"
},
{
"name": "ralouphie/getallheaders",
@ -7799,28 +7848,28 @@
},
{
"name": "spatie/laravel-backup",
"version": "8.1.11",
"version": "8.3.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-backup.git",
"reference": "e4f5c3f6783d40a219a02bc99dc4171ecdd6d20c"
"reference": "3a86fbc39d04f52024dfd57a334a078748e1b5f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-backup/zipball/e4f5c3f6783d40a219a02bc99dc4171ecdd6d20c",
"reference": "e4f5c3f6783d40a219a02bc99dc4171ecdd6d20c",
"url": "https://api.github.com/repos/spatie/laravel-backup/zipball/3a86fbc39d04f52024dfd57a334a078748e1b5f5",
"reference": "3a86fbc39d04f52024dfd57a334a078748e1b5f5",
"shasum": ""
},
"require": {
"ext-zip": "^1.14.0",
"illuminate/console": "^9.0|^10.0",
"illuminate/contracts": "^9.0|^10.0",
"illuminate/events": "^9.0|^10.0",
"illuminate/filesystem": "^9.0|^10.0",
"illuminate/notifications": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0",
"illuminate/console": "^10.10.0",
"illuminate/contracts": "^10.10.0",
"illuminate/events": "^10.10.0",
"illuminate/filesystem": "^10.10.0",
"illuminate/notifications": "^10.10.0",
"illuminate/support": "^10.10.0",
"league/flysystem": "^3.0",
"php": "^8.0",
"php": "^8.1",
"spatie/db-dumper": "^3.0",
"spatie/laravel-package-tools": "^1.6.2",
"spatie/laravel-signal-aware-command": "^1.2",
@ -7835,7 +7884,7 @@
"league/flysystem-aws-s3-v3": "^2.0|^3.0",
"mockery/mockery": "^1.4",
"nunomaduro/larastan": "^2.1",
"orchestra/testbench": "^7.0|^8.0",
"orchestra/testbench": "^8.0",
"pestphp/pest": "^1.20",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
@ -7882,7 +7931,7 @@
],
"support": {
"issues": "https://github.com/spatie/laravel-backup/issues",
"source": "https://github.com/spatie/laravel-backup/tree/8.1.11"
"source": "https://github.com/spatie/laravel-backup/tree/8.3.1"
},
"funding": [
{
@ -7894,7 +7943,7 @@
"type": "other"
}
],
"time": "2023-06-02T08:56:10+00:00"
"time": "2023-08-10T07:53:36+00:00"
},
{
"name": "spatie/laravel-ignition",
@ -7990,16 +8039,16 @@
},
{
"name": "spatie/laravel-package-tools",
"version": "1.15.0",
"version": "1.16.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-package-tools.git",
"reference": "efab1844b8826443135201c4443690f032c3d533"
"reference": "38fe533e93f86a1b2fb1000bf7df09c4748e6458"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/efab1844b8826443135201c4443690f032c3d533",
"reference": "efab1844b8826443135201c4443690f032c3d533",
"url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/38fe533e93f86a1b2fb1000bf7df09c4748e6458",
"reference": "38fe533e93f86a1b2fb1000bf7df09c4748e6458",
"shasum": ""
},
"require": {
@ -8038,7 +8087,7 @@
],
"support": {
"issues": "https://github.com/spatie/laravel-package-tools/issues",
"source": "https://github.com/spatie/laravel-package-tools/tree/1.15.0"
"source": "https://github.com/spatie/laravel-package-tools/tree/1.16.0"
},
"funding": [
{
@ -8046,7 +8095,7 @@
"type": "github"
}
],
"time": "2023-04-27T08:09:01+00:00"
"time": "2023-08-09T14:08:04+00:00"
},
{
"name": "spatie/laravel-signal-aware-command",
@ -10794,6 +10843,78 @@
],
"time": "2023-05-18T08:09:02+00:00"
},
{
"name": "tecnickcom/tcpdf",
"version": "6.6.2",
"source": {
"type": "git",
"url": "https://github.com/tecnickcom/TCPDF.git",
"reference": "e3cffc9bcbc76e89e167e9eb0bbda0cab7518459"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/e3cffc9bcbc76e89e167e9eb0bbda0cab7518459",
"reference": "e3cffc9bcbc76e89e167e9eb0bbda0cab7518459",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"classmap": [
"config",
"include",
"tcpdf.php",
"tcpdf_parser.php",
"tcpdf_import.php",
"tcpdf_barcodes_1d.php",
"tcpdf_barcodes_2d.php",
"include/tcpdf_colors.php",
"include/tcpdf_filters.php",
"include/tcpdf_font_data.php",
"include/tcpdf_fonts.php",
"include/tcpdf_images.php",
"include/tcpdf_static.php",
"include/barcodes/datamatrix.php",
"include/barcodes/pdf417.php",
"include/barcodes/qrcode.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-only"
],
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"role": "lead"
}
],
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"homepage": "http://www.tcpdf.org/",
"keywords": [
"PDFD32000-2008",
"TCPDF",
"barcodes",
"datamatrix",
"pdf",
"pdf417",
"qrcode"
],
"support": {
"issues": "https://github.com/tecnickcom/TCPDF/issues",
"source": "https://github.com/tecnickcom/TCPDF/tree/6.6.2"
},
"funding": [
{
"url": "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&currency_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20tcpdf%20project",
"type": "custom"
}
],
"time": "2022-12-17T10:28:59+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
"version": "2.2.6",
@ -11636,16 +11757,16 @@
},
{
"name": "cmgmyr/phploc",
"version": "8.0.2",
"version": "8.0.3",
"source": {
"type": "git",
"url": "https://github.com/cmgmyr/phploc.git",
"reference": "35e308033e02264a59cb1b56cc2abb1a22483ca8"
"reference": "e61d4729df46c5920ab61973bfa3f70f81a70b5f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cmgmyr/phploc/zipball/35e308033e02264a59cb1b56cc2abb1a22483ca8",
"reference": "35e308033e02264a59cb1b56cc2abb1a22483ca8",
"url": "https://api.github.com/repos/cmgmyr/phploc/zipball/e61d4729df46c5920ab61973bfa3f70f81a70b5f",
"reference": "e61d4729df46c5920ab61973bfa3f70f81a70b5f",
"shasum": ""
},
"require": {
@ -11653,8 +11774,7 @@
"ext-json": "*",
"php": "^7.4 || ^8.0",
"phpunit/php-file-iterator": "^3.0|^4.0",
"sebastian/cli-parser": "^1.0|^2.0",
"sebastian/version": "^3.0|^4.0"
"sebastian/cli-parser": "^1.0|^2.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.2",
@ -11690,7 +11810,7 @@
"homepage": "https://github.com/cmgmyr/phploc",
"support": {
"issues": "https://github.com/cmgmyr/phploc/issues",
"source": "https://github.com/cmgmyr/phploc/tree/8.0.2"
"source": "https://github.com/cmgmyr/phploc/tree/8.0.3"
},
"funding": [
{
@ -11698,7 +11818,7 @@
"type": "github"
}
],
"time": "2023-03-19T10:37:20+00:00"
"time": "2023-08-05T16:49:39+00:00"
},
{
"name": "composer/pcre",
@ -12341,16 +12461,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.22.0",
"version": "v3.23.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "92b019f6c8d79aa26349d0db7671d37440dc0ff3"
"reference": "35af3cbbacfa91e164b252a28ec0b644f1ed4e78"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/92b019f6c8d79aa26349d0db7671d37440dc0ff3",
"reference": "92b019f6c8d79aa26349d0db7671d37440dc0ff3",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/35af3cbbacfa91e164b252a28ec0b644f1ed4e78",
"reference": "35af3cbbacfa91e164b252a28ec0b644f1ed4e78",
"shasum": ""
},
"require": {
@ -12426,7 +12546,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.22.0"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.23.0"
},
"funding": [
{
@ -12434,7 +12554,7 @@
"type": "github"
}
],
"time": "2023-07-16T23:08:06+00:00"
"time": "2023-08-14T12:27:35+00:00"
},
{
"name": "hamcrest/hamcrest-php",
@ -12618,16 +12738,16 @@
},
{
"name": "laravel/dusk",
"version": "v7.9.1",
"version": "v7.9.3",
"source": {
"type": "git",
"url": "https://github.com/laravel/dusk.git",
"reference": "c7261854fa3be500c2e331600eb1b265052690be"
"reference": "8d7ce583fb362472558cc1852adccfcd86cf87e4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/dusk/zipball/c7261854fa3be500c2e331600eb1b265052690be",
"reference": "c7261854fa3be500c2e331600eb1b265052690be",
"url": "https://api.github.com/repos/laravel/dusk/zipball/8d7ce583fb362472558cc1852adccfcd86cf87e4",
"reference": "8d7ce583fb362472558cc1852adccfcd86cf87e4",
"shasum": ""
},
"require": {
@ -12688,9 +12808,9 @@
],
"support": {
"issues": "https://github.com/laravel/dusk/issues",
"source": "https://github.com/laravel/dusk/tree/v7.9.1"
"source": "https://github.com/laravel/dusk/tree/v7.9.3"
},
"time": "2023-07-27T02:09:52+00:00"
"time": "2023-08-03T16:00:26+00:00"
},
{
"name": "league/container",
@ -12776,31 +12896,31 @@
},
{
"name": "mockery/mockery",
"version": "1.6.4",
"version": "1.6.6",
"source": {
"type": "git",
"url": "https://github.com/mockery/mockery.git",
"reference": "d1413755e26fe56a63455f7753221c86cbb88f66"
"reference": "b8e0bb7d8c604046539c1115994632c74dcb361e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mockery/mockery/zipball/d1413755e26fe56a63455f7753221c86cbb88f66",
"reference": "d1413755e26fe56a63455f7753221c86cbb88f66",
"url": "https://api.github.com/repos/mockery/mockery/zipball/b8e0bb7d8c604046539c1115994632c74dcb361e",
"reference": "b8e0bb7d8c604046539c1115994632c74dcb361e",
"shasum": ""
},
"require": {
"hamcrest/hamcrest-php": "^2.0.1",
"lib-pcre": ">=7.0",
"php": ">=7.4,<8.3"
"php": ">=7.3"
},
"conflict": {
"phpunit/phpunit": "<8.0"
},
"require-dev": {
"phpunit/phpunit": "^8.5 || ^9.3",
"phpunit/phpunit": "^8.5 || ^9.6.10",
"psalm/plugin-phpunit": "^0.18.4",
"symplify/easy-coding-standard": "^11.5.0",
"vimeo/psalm": "^5.13.1"
"vimeo/psalm": "^4.30"
},
"type": "library",
"autoload": {
@ -12857,7 +12977,7 @@
"security": "https://github.com/mockery/mockery/security/advisories",
"source": "https://github.com/mockery/mockery"
},
"time": "2023-07-19T15:51:02+00:00"
"time": "2023-08-09T00:03:52+00:00"
},
{
"name": "myclabs/deep-copy",
@ -13494,16 +13614,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.10.26",
"version": "1.10.29",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "5d660cbb7e1b89253a47147ae44044f49832351f"
"reference": "ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/5d660cbb7e1b89253a47147ae44044f49832351f",
"reference": "5d660cbb7e1b89253a47147ae44044f49832351f",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1",
"reference": "ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1",
"shasum": ""
},
"require": {
@ -13552,7 +13672,7 @@
"type": "tidelift"
}
],
"time": "2023-07-19T12:44:37+00:00"
"time": "2023-08-14T13:24:11+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -14325,16 +14445,16 @@
},
{
"name": "sebastian/global-state",
"version": "5.0.5",
"version": "5.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2"
"reference": "bde739e7565280bda77be70044ac1047bc007e34"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2",
"reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34",
"reference": "bde739e7565280bda77be70044ac1047bc007e34",
"shasum": ""
},
"require": {
@ -14377,7 +14497,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5"
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6"
},
"funding": [
{
@ -14385,7 +14505,7 @@
"type": "github"
}
],
"time": "2022-02-14T08:28:10+00:00"
"time": "2023-08-02T09:26:13+00:00"
},
{
"name": "sebastian/lines-of-code",
@ -15661,16 +15781,16 @@
},
{
"name": "vimeo/psalm",
"version": "5.14.0",
"version": "5.14.1",
"source": {
"type": "git",
"url": "https://github.com/vimeo/psalm.git",
"reference": "b2942cefed8443002bd3f245c4cd0a54193716d8"
"reference": "b9d355e0829c397b9b3b47d0c0ed042a8a70284d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vimeo/psalm/zipball/b2942cefed8443002bd3f245c4cd0a54193716d8",
"reference": "b2942cefed8443002bd3f245c4cd0a54193716d8",
"url": "https://api.github.com/repos/vimeo/psalm/zipball/b9d355e0829c397b9b3b47d0c0ed042a8a70284d",
"reference": "b9d355e0829c397b9b3b47d0c0ed042a8a70284d",
"shasum": ""
},
"require": {
@ -15761,9 +15881,9 @@
],
"support": {
"issues": "https://github.com/vimeo/psalm/issues",
"source": "https://github.com/vimeo/psalm/tree/5.14.0"
"source": "https://github.com/vimeo/psalm/tree/5.14.1"
},
"time": "2023-07-30T20:18:56+00:00"
"time": "2023-08-01T05:16:55+00:00"
}
],
"aliases": [],

View file

@ -132,4 +132,16 @@ return [
'password_timeout' => env('PASSWORD_CONFIRM_TIMEOUT', 10800),
/*
|--------------------------------------------------------------------------
| Login form autocomplete
|--------------------------------------------------------------------------
|
| Determine whether to include autocomplete="off" on the login form. Some users may want to disable
| autocomplete for compliance with security requirements.
|
*/
'login_autocomplete' => env('LOGIN_AUTOCOMPLETE', false),
];

View file

@ -25,6 +25,7 @@ return [
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'mandrill' => [

View file

@ -30,7 +30,7 @@ class UserFactory extends Factory
'locale' => 'en',
'notes' => 'Created by DB seeder',
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'permissions' => '{"user":"0"}',
'permissions' => '{}',
'phone' => $this->faker->phoneNumber(),
'state' => $this->faker->stateAbbr(),
'username' => $this->faker->username(),
@ -81,11 +81,7 @@ class UserFactory extends Factory
public function superuser()
{
return $this->state(function () {
return [
'permissions' => '{"superuser":"1"}',
];
});
return $this->appendPermission(['superuser' => '1']);
}
public function admin()
@ -102,333 +98,204 @@ class UserFactory extends Factory
public function viewAssets()
{
return $this->state(function () {
return [
'permissions' => '{"assets.view":"1"}',
];
});
return $this->appendPermission(['assets.view' => '1']);
}
public function createAssets()
{
return $this->state(function () {
return [
'permissions' => '{"assets.create":"1"}',
];
});
return $this->appendPermission(['assets.create' => '1']);
}
public function editAssets()
{
return $this->state(function () {
return [
'permissions' => '{"assets.edit":"1"}',
];
});
return $this->appendPermission(['assets.edit' => '1']);
}
public function deleteAssets()
{
return $this->state(function () {
return [
'permissions' => '{"assets.delete":"1"}',
];
});
return $this->appendPermission(['assets.delete' => '1']);
}
public function checkinAssets()
{
return $this->state(function () {
return [
'permissions' => '{"assets.checkin":"1"}',
];
});
return $this->appendPermission(['assets.checkin' => '1']);
}
public function checkoutAssets()
{
return $this->state(function () {
return [
'permissions' => '{"assets.checkout":"1"}',
];
});
return $this->appendPermission(['assets.checkout' => '1']);
}
public function viewRequestableAssets()
{
return $this->state(function () {
return [
'permissions' => '{"assets.view.requestable":"1"}',
];
});
return $this->appendPermission(['assets.view.requestable' => '1']);
}
public function viewAccessories()
{
return $this->state(function () {
return [
'permissions' => '{"accessories.view":"1"}',
];
});
return $this->appendPermission(['accessories.view' => '1']);
}
public function createAccessories()
{
return $this->state(function () {
return [
'permissions' => '{"accessories.create":"1"}',
];
});
return $this->appendPermission(['accessories.create' => '1']);
}
public function editAccessories()
{
return $this->state(function () {
return [
'permissions' => '{"accessories.edit":"1"}',
];
});
return $this->appendPermission(['accessories.edit' => '1']);
}
public function deleteAccessories()
{
return $this->state(function () {
return [
'permissions' => '{"accessories.delete":"1"}',
];
});
return $this->appendPermission(['accessories.delete' => '1']);
}
public function checkinAccessories()
{
return $this->state(function () {
return [
'permissions' => '{"accessories.checkin":"1"}',
];
});
return $this->appendPermission(['accessories.checkin' => '1']);
}
public function checkoutAccessories()
{
return $this->state(function () {
return [
'permissions' => '{"accessories.checkout":"1"}',
];
});
return $this->appendPermission(['accessories.checkout' => '1']);
}
public function viewConsumables()
{
return $this->state(function () {
return [
'permissions' => '{"consumables.view":"1"}',
];
});
return $this->appendPermission(['consumables.view' => '1']);
}
public function createConsumables()
{
return $this->state(function () {
return [
'permissions' => '{"consumables.create":"1"}',
];
});
return $this->appendPermission(['consumables.create' => '1']);
}
public function editConsumables()
{
return $this->state(function () {
return [
'permissions' => '{"consumables.edit":"1"}',
];
});
return $this->appendPermission(['consumables.edit' => '1']);
}
public function deleteConsumables()
{
return $this->state(function () {
return [
'permissions' => '{"consumables.delete":"1"}',
];
});
return $this->appendPermission(['consumables.delete' => '1']);
}
public function checkinConsumables()
{
return $this->state(function () {
return [
'permissions' => '{"consumables.checkin":"1"}',
];
});
return $this->appendPermission(['consumables.checkin' => '1']);
}
public function checkoutConsumables()
{
return $this->state(function () {
return [
'permissions' => '{"consumables.checkout":"1"}',
];
});
return $this->appendPermission(['consumables.checkout' => '1']);
}
public function viewDepartments()
{
return $this->state(function () {
return [
'permissions' => '{"departments.view":"1"}',
];
});
return $this->appendPermission(['departments.view' => '1']);
}
public function viewLicenses()
{
return $this->state(function () {
return [
'permissions' => '{"licenses.view":"1"}',
];
});
return $this->appendPermission(['licenses.view' => '1']);
}
public function createLicenses()
{
return $this->state(function () {
return [
'permissions' => '{"licenses.create":"1"}',
];
});
return $this->appendPermission(['licenses.create' => '1']);
}
public function editLicenses()
{
return $this->state(function () {
return [
'permissions' => '{"licenses.edit":"1"}',
];
});
return $this->appendPermission(['licenses.edit' => '1']);
}
public function deleteLicenses()
{
return $this->state(function () {
return [
'permissions' => '{"licenses.delete":"1"}',
];
});
return $this->appendPermission(['licenses.delete' => '1']);
}
public function checkoutLicenses()
{
return $this->state(function () {
return [
'permissions' => '{"licenses.checkout":"1"}',
];
});
return $this->appendPermission(['licenses.checkout' => '1']);
}
public function viewKeysLicenses()
{
return $this->state(function () {
return [
'permissions' => '{"licenses.keys":"1"}',
];
});
return $this->appendPermission(['licenses.keys' => '1']);
}
public function viewComponents()
{
return $this->state(function () {
return [
'permissions' => '{"components.view":"1"}',
];
});
return $this->appendPermission(['components.view' => '1']);
}
public function createComponents()
{
return $this->state(function () {
return [
'permissions' => '{"components.create":"1"}',
];
});
return $this->appendPermission(['components.create' => '1']);
}
public function editComponents()
{
return $this->state(function () {
return [
'permissions' => '{"components.edit":"1"}',
];
});
return $this->appendPermission(['components.edit' => '1']);
}
public function deleteComponents()
{
return $this->state(function () {
return [
'permissions' => '{"components.delete":"1"}',
];
});
return $this->appendPermission(['components.delete' => '1']);
}
public function checkinComponents()
{
return $this->state(function () {
return [
'permissions' => '{"components.checkin":"1"}',
];
});
return $this->appendPermission(['components.checkin' => '1']);
}
public function checkoutComponents()
{
return $this->state(function () {
return [
'permissions' => '{"components.checkout":"1"}',
];
});
return $this->appendPermission(['components.checkout' => '1']);
}
public function viewUsers()
{
return $this->state(function () {
return [
'permissions' => '{"users.view":"1"}',
];
});
return $this->appendPermission(['users.view' => '1']);
}
public function createUsers()
{
return $this->state(function () {
return [
'permissions' => '{"users.create":"1"}',
];
});
return $this->appendPermission(['users.create' => '1']);
}
public function editUsers()
{
return $this->state(function () {
return [
'permissions' => '{"users.edit":"1"}',
];
});
return $this->appendPermission(['users.edit' => '1']);
}
public function deleteUsers()
{
return $this->state(function () {
return [
'permissions' => '{"users.delete":"1"}',
];
});
return $this->appendPermission(['users.delete' => '1']);
}
public function canEditOwnLocation()
{
return $this->state(function () {
return $this->appendPermission(['self.edit_location' => '1']);
}
public function canViewReports()
{
return $this->appendPermission(['reports.view' => '1']);
}
private function appendPermission(array $permission)
{
return $this->state(function ($currentState) use ($permission) {
return [
'permissions' => '{"self.edit_location":"1"}',
'permissions' => json_encode(
array_merge(
json_decode($currentState['permissions'], true),
$permission
)
),
];
});
}

View file

@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddLabel2Settings extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->boolean('label2_enable')->default(false);
$table->string('label2_template')->nullable()->default('DefaultLabel');
$table->string('label2_title')->nullable()->default(null);
$table->boolean('label2_asset_logo')->default(false);
$table->string('label2_1d_type')->default('default');
$table->string('label2_2d_type')->default('default');
$table->string('label2_2d_target')->default('hardware_id');
$table->string('label2_fields')->default(
trans('admin/hardware/form.name').'=name;'.
trans('admin/hardware/form.serial').'=serial;'.
trans('admin/hardware/form.model').'=model.name;'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
if (Schema::hasColumn('settings', 'label2_enable')) $table->dropColumn('label2_enable');
if (Schema::hasColumn('settings', 'label2_template')) $table->dropColumn('label2_template');
if (Schema::hasColumn('settings', 'label2_title')) $table->dropColumn('label2_title');
if (Schema::hasColumn('settings', 'label2_asset_logo')) $table->dropColumn('label2_asset_logo');
if (Schema::hasColumn('settings', 'label2_1d_type')) $table->dropColumn('label2_1d_type');
if (Schema::hasColumn('settings', 'label2_2d_type')) $table->dropColumn('label2_2d_type');
if (Schema::hasColumn('settings', 'label2_2d_target')) $table->dropColumn('label2_2d_target');
if (Schema::hasColumn('settings', 'label2_fields')) $table->dropColumn('label2_fields');
});
}
}

View file

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ChangeWebhookSettingsVariableType extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->text('webhook_endpoint')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->varchar('webhook_endpoint')->change();
});
}
}

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddEmailToCompanies extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('companies', function (Blueprint $table) {
$table->string('email', 150)->after('fax')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('companies', function (Blueprint $table) {
$table->dropColumn('email');
});
}
}

31
package-lock.json generated
View file

@ -10,6 +10,7 @@
"acorn-import-assertions": "^1.9.0",
"admin-lte": "^2.4.18",
"ajv": "^6.12.6",
"alpinejs": "^3.10.5",
"blueimp-file-upload": "^9.34.0",
"bootstrap": "^3.4.1",
"bootstrap-colorpicker": "^2.5.3",
@ -24,7 +25,7 @@
"jquery-ui": "^1.13.2",
"jquery-ui-bundle": "^1.12.1",
"jquery.iframe-transport": "^1.0.0",
"jspdf-autotable": "^3.5.24",
"jspdf-autotable": "^3.5.30",
"less": "^4.1.2",
"less-loader": "^6.0",
"list.js": "^1.5.0",
@ -35,7 +36,7 @@
"tableexport.jquery.plugin": "1.28.0",
"tether": "^1.4.0",
"vue-resource": "^1.5.2",
"webpack": "^5.87.0"
"webpack": "^5.88.2"
},
"devDependencies": {
"axios": "^0.27.2",
@ -2290,6 +2291,19 @@
"dev": true,
"license": "ISC"
},
"node_modules/@vue/reactivity": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.5.tgz",
"integrity": "sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==",
"dependencies": {
"@vue/shared": "3.1.5"
}
},
"node_modules/@vue/shared": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.5.tgz",
"integrity": "sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA=="
},
"node_modules/@webassemblyjs/ast": {
"version": "1.11.5",
"license": "MIT",
@ -2605,6 +2619,14 @@
"ajv": "^6.9.1"
}
},
"node_modules/alpinejs": {
"version": "3.12.3",
"resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.12.3.tgz",
"integrity": "sha512-fLz2dfYQ3xCk7Ip8LiIpV2W+9brUyex2TAE7Z0BCvZdUDklJE+n+a8gCgLWzfZ0GzZNZu7HUP8Z0z6Xbm6fsSA==",
"dependencies": {
"@vue/reactivity": "~3.1.1"
}
},
"node_modules/ansi-html-community": {
"version": "0.0.8",
"dev": true,
@ -7032,8 +7054,9 @@
}
},
"node_modules/jspdf-autotable": {
"version": "3.5.28",
"license": "MIT",
"version": "3.5.31",
"resolved": "https://registry.npmjs.org/jspdf-autotable/-/jspdf-autotable-3.5.31.tgz",
"integrity": "sha512-Lc1KuLGDQWW/5t57Z/+c2E94XQV3jV2QVU3xMRiwvcm/nMx79aCkpPCsxLzJZVFneZvz4XoA8+egQR1QajYiWw==",
"peerDependencies": {
"jspdf": "^2.5.1"
}

View file

@ -29,6 +29,7 @@
"acorn-import-assertions": "^1.9.0",
"admin-lte": "^2.4.18",
"ajv": "^6.12.6",
"alpinejs": "^3.10.5",
"blueimp-file-upload": "^9.34.0",
"bootstrap": "^3.4.1",
"bootstrap-colorpicker": "^2.5.3",
@ -43,7 +44,7 @@
"jquery-ui": "^1.13.2",
"jquery-ui-bundle": "^1.12.1",
"jquery.iframe-transport": "^1.0.0",
"jspdf-autotable": "^3.5.24",
"jspdf-autotable": "^3.5.30",
"less": "^4.1.2",
"less-loader": "^6.0",
"list.js": "^1.5.0",
@ -54,6 +55,6 @@
"tableexport.jquery.plugin": "1.28.0",
"tether": "^1.4.0",
"vue-resource": "^1.5.2",
"webpack": "^5.87.0"
"webpack": "^5.88.2"
}
}

BIN
public/js/dist/all-defer.js vendored Normal file

Binary file not shown.

Binary file not shown.

View file

@ -18,7 +18,7 @@
"/css/dist/skins/skin-green.css": "/css/dist/skins/skin-green.css?id=b48f4d8af0e1ca5621c161e93951109f",
"/css/dist/skins/skin-contrast.css": "/css/dist/skins/skin-contrast.css?id=f0fbbb0ac729ea092578fb05ca615460",
"/css/dist/skins/skin-red.css": "/css/dist/skins/skin-red.css?id=b9a74ec0cd68f83e7480d5ae39919beb",
"/css/dist/all.css": "/css/dist/all.css?id=6e1507ccfe6bccaa1279320028980aec",
"/css/dist/all.css": "/css/dist/all.css?id=c5f8982eb14ba2c7e0c0fec60519afc6",
"/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/css/webfonts/fa-brands-400.ttf": "/css/webfonts/fa-brands-400.ttf?id=e2e2b1797606a266ed55549f5bb5a179",
@ -29,10 +29,11 @@
"/css/webfonts/fa-solid-900.woff2": "/css/webfonts/fa-solid-900.woff2?id=eea38615e7b5dbbaf88c263f2230cc32",
"/css/webfonts/fa-v4compatibility.ttf": "/css/webfonts/fa-v4compatibility.ttf?id=6ebbf5afc34f54463abc2b81ca637364",
"/css/webfonts/fa-v4compatibility.woff2": "/css/webfonts/fa-v4compatibility.woff2?id=67b8a78b7e80e805cfa4ee0421895ba4",
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=f5935cf8eaf9c1f71da0c9245d730471",
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=281bcfe26549412d128f695234961081",
"/js/build/vendor.js": "/js/build/vendor.js?id=8ac1d250496313e93744790e5138305d",
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=40e2dc8b5b29e244bb545f78e2a3242b",
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=df78f0c4cc93c29c02a41144590f6350",
"/js/dist/all.js": "/js/dist/all.js?id=b487452bd6bef7fa6201586415d383f2",
"/js/dist/all-defer.js": "/js/dist/all-defer.js?id=7829a391ab2f89926465398bebb7df8d",
"/css/dist/skins/skin-green.min.css": "/css/dist/skins/skin-green.min.css?id=b48f4d8af0e1ca5621c161e93951109f",
"/css/dist/skins/skin-green-dark.min.css": "/css/dist/skins/skin-green-dark.min.css?id=44f9320d0739f419c9246f7f39395b02",
"/css/dist/skins/skin-black.min.css": "/css/dist/skins/skin-black.min.css?id=1f33ca3d860461c1127ec465ab3ebb6b",

View file

@ -1 +1,2 @@
!.gitignore
!company-image-test.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View file

@ -1,7 +1,7 @@
<?php
return array(
'personal_api_keys' => 'Personal API Keys',
'personal_api_keys' => '私有API 金鑰',
'api_key_warning' => 'When generating an API token, be sure to copy it down immediately as they
will not be visible to you again.',
'api_base_url' => 'Your API base url is located at:',

View file

@ -8,6 +8,8 @@ return array(
'clone' => 'Klone Kategorie',
'create' => 'Skep Kategorie',
'edit' => 'Wysig Kategorie',
'email_will_be_sent_due_to_global_eula' => 'An email will be sent to the user because the global EULA is being used.',
'email_will_be_sent_due_to_category_eula' => 'An email will be sent to the user because a EULA is set for this category.',
'eula_text' => 'Kategorie EULA',
'eula_text_help' => 'Hierdie veld laat u toe om u EULA\'s vir spesifieke soorte bates aan te pas. As u slegs een EULA vir al u bates het, kan u die onderstaande boks selekteer om die primêre standaard te gebruik.',
'name' => 'Kategorie Naam',

View file

@ -51,4 +51,7 @@ return [
'display_in_user_view_table' => 'Visible to User',
'auto_add_to_fieldsets' => 'Automatically add this to every new fieldset',
'add_to_preexisting_fieldsets' => 'Add to any existing fieldsets',
'show_in_listview' => 'Show in list views by default. Authorized users will still be able to show/hide via the column selector.',
'show_in_listview_short' => 'Show in lists',
];

View file

@ -12,6 +12,7 @@ return [
'clone' => 'Klone Bate',
'deployable' => 'verbintenis',
'deleted' => 'This asset has been deleted.',
'delete_confirm' => 'Are you sure you want to delete this asset?',
'edit' => 'Wysig bate',
'model_deleted' => 'This Assets model has been deleted. You must restore the model before you can restore the Asset.',
'model_invalid' => 'The Model of this Asset is invalid.',
@ -19,7 +20,7 @@ return [
'requestable' => 'Requestable',
'requested' => 'versoek',
'not_requestable' => 'Not Requestable',
'requestable_status_warning' => 'Do not change requestable status',
'requestable_status_warning' => 'Do not change requestable status',
'restore' => 'Herstel bate',
'pending' => 'hangende',
'undeployable' => 'Undeployable',
@ -45,4 +46,5 @@ return [
'alert_details' => 'Please see below for details.',
'custom_export' => 'Custom Export',
'mfg_warranty_lookup' => ':manufacturer Warranty Status Lookup',
'user_department' => 'User Department',
];

View file

@ -3,7 +3,7 @@
return array(
'does_not_exist' => 'Model bestaan nie.',
'no_association' => 'NO MODEL ASSOCIATED.',
'no_association' => 'WARNING! The asset model for this item is invalid or missing!',
'no_association_fix' => 'This will break things in weird and horrible ways. Edit this asset now to assign it a model.',
'assoc_users' => 'Hierdie model word tans geassosieer met een of meer bates en kan nie verwyder word nie. Verwyder asseblief die bates en probeer dan weer uitvee.',

View file

@ -264,7 +264,7 @@ return [
'accept_eula' => 'Acceptance Agreement',
'supplier' => 'verskaffer',
'suppliers' => 'Verskaffers',
'sure_to_delete' => 'Is jy seker jy wil verwyder',
'sure_to_delete' => 'Is jy seker jy wil verwyder',
'submit' => 'Indien',
'target' => 'teiken',
'time_and_date_display' => 'Tyd en datum vertoon',
@ -368,8 +368,8 @@ return [
'notification_warning' => 'Warning:',
'notification_info' => 'Info:',
'asset_information' => 'Asset Information',
'model_name' => 'Model Name:',
'asset_name' => 'Asset Name:',
'model_name' => 'Model Name',
'asset_name' => 'Asset Name',
'consumable_information' => 'Consumable Information:',
'consumable_name' => 'Consumable Name:',
'accessory_information' => 'Accessory Information:',
@ -413,7 +413,7 @@ return [
'integration_option' => 'Integration Option',
'log_does_not_exist' => 'No matching log record exists.',
'merge_users' => 'Merge Users',
'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licences, etc will be moved over to the selected user and the other users will be marked as deleted.',
'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licenses, etc will be moved over to the selected user and the other users will be marked as deleted.',
'warning_merge_information' => 'This action CANNOT be undone and should ONLY be used when you need to merge users because of a bad import or sync. Be sure to run a backup first.',
'no_users_selected' => 'No users selected',
'not_enough_users_selected' => 'At least :count users must be selected',
@ -436,6 +436,7 @@ return [
'errors_importing' => 'Some Errors occurred while importing: ',
'warning' => 'WARNING: :warning',
'success_redirecting' => '"Success... Redirecting.',
'cancel_request' => 'Cancel this item request',
'setup_successful_migrations' => 'Your database tables have been created',
'setup_migration_output' => 'Migration output:',
'setup_migration_create_user' => 'Next: Create User',
@ -448,5 +449,30 @@ return [
'modal_confirm_generic' => 'Are you sure?',
'cannot_be_deleted' => 'This item cannot be deleted',
'undeployable_tooltip' => 'This item cannot be checked out. Check the quantity remaining.',
'serial_number' => 'Serial Number',
'item_notes' => ':item Notes',
'item_name_var' => ':item Name',
'importer' => [
'checked_out_to_fullname' => 'Checked Out to: Full Name',
'checked_out_to_first_name' => 'Checked Out to: First Name',
'checked_out_to_last_name' => 'Checked Out to: Last Name',
'checked_out_to_username' => 'Checked Out to: Username',
'checked_out_to_email' => 'Checked Out to: Email',
'checked_out_to_tag' => 'Checked Out to: Asset Tag',
'manager_first_name' => 'Manager First Name',
'manager_last_name' => 'Manager Last Name',
'manager_full_name' => 'Manager Full Name',
'manager_username' => 'Manager Username',
'checkout_type' => 'Checkout Type',
'checkout_location' => 'Checkout to Location',
'image_filename' => 'Image Filename',
'do_not_import' => 'Do Not Import',
'vip' => 'VIP',
'avatar' => 'Avatar',
'gravatar' => 'Gravatar Email',
'currency' => 'Currency',
'address2' => 'Address Line 2',
'import_note' => 'Imported using csv importer',
],
];

View file

@ -8,6 +8,8 @@ return array(
'clone' => 'Clone Category',
'create' => 'Create Category',
'edit' => 'Edit Category',
'email_will_be_sent_due_to_global_eula' => 'An email will be sent to the user because the global EULA is being used.',
'email_will_be_sent_due_to_category_eula' => 'An email will be sent to the user because a EULA is set for this category.',
'eula_text' => 'Category EULA',
'eula_text_help' => 'This field allows you to customize your EULAs for specific types of assets. If you only have one EULA for all of your assets, you can check the box below to use the primary default.',
'name' => 'Category Name',

View file

@ -51,4 +51,7 @@ return [
'display_in_user_view_table' => 'Visible to User',
'auto_add_to_fieldsets' => 'Automatically add this to every new fieldset',
'add_to_preexisting_fieldsets' => 'Add to any existing fieldsets',
'show_in_listview' => 'Show in list views by default. Authorized users will still be able to show/hide via the column selector.',
'show_in_listview_short' => 'Show in lists',
];

View file

@ -12,6 +12,7 @@ return [
'clone' => 'Clone Asset',
'deployable' => 'Deployable',
'deleted' => 'This asset has been deleted.',
'delete_confirm' => 'Are you sure you want to delete this asset?',
'edit' => 'Edit Asset',
'model_deleted' => 'This Assets model has been deleted. You must restore the model before you can restore the Asset.',
'model_invalid' => 'The Model of this Asset is invalid.',
@ -19,7 +20,7 @@ return [
'requestable' => 'Requestable',
'requested' => 'Requested',
'not_requestable' => 'Not Requestable',
'requestable_status_warning' => 'Do not change requestable status',
'requestable_status_warning' => 'Do not change requestable status',
'restore' => 'Restore Asset',
'pending' => 'Pending',
'undeployable' => 'Undeployable',
@ -45,4 +46,5 @@ return [
'alert_details' => 'Please see below for details.',
'custom_export' => 'Custom Export',
'mfg_warranty_lookup' => ':manufacturer Warranty Status Lookup',
'user_department' => 'User Department',
];

View file

@ -3,7 +3,7 @@
return array(
'does_not_exist' => 'Model does not exist.',
'no_association' => 'NO MODEL ASSOCIATED.',
'no_association' => 'WARNING! The asset model for this item is invalid or missing!',
'no_association_fix' => 'This will break things in weird and horrible ways. Edit this asset now to assign it a model.',
'assoc_users' => 'This model is currently associated with one or more assets and cannot be deleted. Please delete the assets, and then try deleting again. ',

View file

@ -1,56 +1,56 @@
<?php
return [
'accessories' => 'Accessories',
'accessories' => 'መለዋወጫዎች',
'activated' => 'Activated',
'accepted_date' => 'Date Accepted',
'accessory' => 'Accessory',
'accessory_report' => 'Accessory Report',
'action' => 'Action',
'activity_report' => 'Activity Report',
'address' => 'Address',
'admin' => 'Admin',
'administrator' => 'Administrator',
'add_seats' => 'Added seats',
'age' => "Age",
'all_assets' => 'All Assets',
'all' => 'All',
'archived' => 'Archived',
'asset_models' => 'Asset Models',
'asset_model' => 'Model',
'asset' => 'Asset',
'asset_report' => 'Asset Report',
'asset_tag' => 'Asset Tag',
'asset_tags' => 'Asset Tags',
'assets_available' => 'Assets available',
'accept_assets' => 'Accept Assets :name',
'accept_assets_menu' => 'Accept Assets',
'audit' => 'Audit',
'audit_report' => 'Audit Log',
'assets' => 'Assets',
'assets_audited' => 'assets audited',
'assets_checked_in_count' => 'assets checked in',
'assets_checked_out_count' => 'assets checked out',
'asset_deleted_warning' => 'This asset has been deleted. You must restore it before you can assign it to someone.',
'assigned_date' => 'Date Assigned',
'assigned_to' => 'Assigned to :name',
'assignee' => 'Assigned to',
'avatar_delete' => 'Delete Avatar',
'avatar_upload' => 'Upload Avatar',
'back' => 'Back',
'bad_data' => 'Nothing found. Maybe bad data?',
'bulkaudit' => 'Bulk Audit',
'bulkaudit_status' => 'Audit Status',
'bulk_checkout' => 'Bulk Checkout',
'bulk_edit' => 'Bulk Edit',
'bulk_delete' => 'Bulk Delete',
'bulk_actions' => 'Bulk Actions',
'bulk_checkin_delete' => 'Bulk Checkin / Delete Users',
'byod' => 'BYOD',
'byod_help' => 'This device is owned by the user',
'bystatus' => 'by Status',
'cancel' => 'Cancel',
'categories' => 'Categories',
'accepted_date' => 'የተቀበለበት ቀን',
'accessory' => 'መለዋወጫ',
'accessory_report' => 'የመለዋወጫ ዘገባ',
'action' => 'ተግባር',
'activity_report' => 'የእንቅስቃሴ ዘገባ',
'address' => 'አድራሻ',
'admin' => 'ተቆጣጣሪ',
'administrator' => 'አስተዳዳሪ',
'add_seats' => 'የተጨመሩ መቀመጫዎች',
'age' => "እድሜ",
'all_assets' => 'ኹሉም ንብረቶች',
'all' => 'ኹሉም',
'archived' => 'የተመኸደረ',
'asset_models' => 'የንብረት ዓይነቶች',
'asset_model' => 'ሞዴል',
'asset' => 'ንብረት',
'asset_report' => 'የንብረት ዘገባ',
'asset_tag' => 'የንብረት መለያ',
'asset_tags' => 'የንብረት መለያዎች',
'assets_available' => 'የሚያገለግሉ ንብረቶች',
'accept_assets' => 'ገቢ ንብረቶች፥ ስም',
'accept_assets_menu' => 'የገቡ ንብረቶች',
'audit' => 'ቁጥጥር',
'audit_report' => 'የቁጥጥር መዝገብ',
'assets' => 'ንብረቶች',
'assets_audited' => 'የተረጋገጡ ንብረቶች',
'assets_checked_in_count' => 'የተመለሱ ንብረቶች',
'assets_checked_out_count' => 'ወጪ የሆኑ ንብረቶች',
'asset_deleted_warning' => 'ይህ ንብረት ተሰርዟል። ለሌላ ሰው ከመስጠት በፊት መልሶ መመዝገብ ያስፈልጋል።',
'assigned_date' => 'የተሰጠበት ቀን',
'assigned_to' => 'የተሰጠው፥ ስም',
'assignee' => 'የተሰጠው',
'avatar_delete' => 'የተሰረዘ አምሳያ',
'avatar_upload' => 'የተጫነ አምሳያ',
'back' => 'ወደኋላ',
'bad_data' => 'ምንም አልተገኘም። የተበላሸ ውሂብ ይሆን?',
'bulkaudit' => 'የጅምላ ኦዲት',
'bulkaudit_status' => 'የኦዲት ሁኔታ',
'bulk_checkout' => 'በጅምላ ማውጣት',
'bulk_edit' => 'የጅምላ አርትዖት',
'bulk_delete' => 'የጅምላ ስረዛ',
'bulk_actions' => 'የጅምላ ተግባር',
'bulk_checkin_delete' => 'የጅምላ ተመላሽ/ የተሰረዙ ተጠቃሚዎች',
'byod' => 'ባይኦድ',
'byod_help' => 'መሳሪያው የተጠቃሚው ነው',
'bystatus' => 'በሁኔታ',
'cancel' => 'ተወው',
'categories' => 'ምድብ',
'category' => 'Category',
'change' => 'In/Out',
'changeemail' => 'Change Email Address',
@ -264,7 +264,7 @@ return [
'accept_eula' => 'Acceptance Agreement',
'supplier' => 'Supplier',
'suppliers' => 'Suppliers',
'sure_to_delete' => 'Are you sure you wish to delete',
'sure_to_delete' => 'Are you sure you wish to delete',
'submit' => 'Submit',
'target' => 'Target',
'time_and_date_display' => 'Time and Date Display',
@ -368,8 +368,8 @@ return [
'notification_warning' => 'Warning:',
'notification_info' => 'Info:',
'asset_information' => 'Asset Information',
'model_name' => 'Model Name:',
'asset_name' => 'Asset Name:',
'model_name' => 'Model Name',
'asset_name' => 'Asset Name',
'consumable_information' => 'Consumable Information:',
'consumable_name' => 'Consumable Name:',
'accessory_information' => 'Accessory Information:',
@ -413,7 +413,7 @@ return [
'integration_option' => 'Integration Option',
'log_does_not_exist' => 'No matching log record exists.',
'merge_users' => 'Merge Users',
'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licences, etc will be moved over to the selected user and the other users will be marked as deleted.',
'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licenses, etc will be moved over to the selected user and the other users will be marked as deleted.',
'warning_merge_information' => 'This action CANNOT be undone and should ONLY be used when you need to merge users because of a bad import or sync. Be sure to run a backup first.',
'no_users_selected' => 'No users selected',
'not_enough_users_selected' => 'At least :count users must be selected',
@ -436,6 +436,7 @@ return [
'errors_importing' => 'Some Errors occurred while importing: ',
'warning' => 'WARNING: :warning',
'success_redirecting' => '"Success... Redirecting.',
'cancel_request' => 'Cancel this item request',
'setup_successful_migrations' => 'Your database tables have been created',
'setup_migration_output' => 'Migration output:',
'setup_migration_create_user' => 'Next: Create User',
@ -448,5 +449,30 @@ return [
'modal_confirm_generic' => 'Are you sure?',
'cannot_be_deleted' => 'This item cannot be deleted',
'undeployable_tooltip' => 'This item cannot be checked out. Check the quantity remaining.',
'serial_number' => 'Serial Number',
'item_notes' => ':item Notes',
'item_name_var' => ':item Name',
'importer' => [
'checked_out_to_fullname' => 'Checked Out to: Full Name',
'checked_out_to_first_name' => 'Checked Out to: First Name',
'checked_out_to_last_name' => 'Checked Out to: Last Name',
'checked_out_to_username' => 'Checked Out to: Username',
'checked_out_to_email' => 'Checked Out to: Email',
'checked_out_to_tag' => 'Checked Out to: Asset Tag',
'manager_first_name' => 'Manager First Name',
'manager_last_name' => 'Manager Last Name',
'manager_full_name' => 'Manager Full Name',
'manager_username' => 'Manager Username',
'checkout_type' => 'Checkout Type',
'checkout_location' => 'Checkout to Location',
'image_filename' => 'Image Filename',
'do_not_import' => 'Do Not Import',
'vip' => 'VIP',
'avatar' => 'Avatar',
'gravatar' => 'Gravatar Email',
'currency' => 'Currency',
'address2' => 'Address Line 2',
'import_note' => 'Imported using csv importer',
],
];

View file

@ -8,6 +8,8 @@ return array(
'clone' => 'نسخ التصنيف',
'create' => 'إنشاء تصنيف',
'edit' => 'تعديل التصنيف',
'email_will_be_sent_due_to_global_eula' => 'سيتم إرسال بريد إلكتروني إلى المستخدم لأنه يتم استخدام اتفاقية ترخيص المستخدم العالمية.',
'email_will_be_sent_due_to_category_eula' => 'سيتم إرسال بريد إلكتروني إلى المستخدم لأنه تم تعيين اتفاقية ترخيص دخول لهذه الفئة.',
'eula_text' => 'إتفاقية ترخيص المستخدم النهائي للتصنيف',
'eula_text_help' => 'يسمح لك هذا الحقل بتخصيص (اتفاقية ترخيص المستخدم) لأنواع معينة من الأصول. اذا كنت تمتلك اتفاقية واحدة لجميع أصولك يمكنك أن تقوم بتأشير المربع في الأسفل لاستخدام الاتفاقية الافتراضية.',
'name' => 'اسم التصنيف',

View file

@ -51,4 +51,7 @@ return [
'display_in_user_view_table' => 'Visible to User',
'auto_add_to_fieldsets' => 'Automatically add this to every new fieldset',
'add_to_preexisting_fieldsets' => 'Add to any existing fieldsets',
'show_in_listview' => 'Show in list views by default. Authorized users will still be able to show/hide via the column selector.',
'show_in_listview_short' => 'Show in lists',
];

View file

@ -9,7 +9,7 @@ return [
'bulk_restore_warn' => 'أنت على وشك استعادة :asset_count الأصول.',
'bulk_update' => 'تحديث للأصول المحددة',
'bulk_update_help' => 'يتيح لك هذا النموذج تحديث عدة أصول دفعة واحدة. قم بملء الحقول التي تحتاج إلى تغييرها. ستظل أية حقول فارغة بدون تغيير. ',
'bulk_update_warn' => 'You are about to edit the properties of a single asset.|You are about to edit the properties of :asset_count assets.',
'bulk_update_warn' => 'أنت على وشك تعديل خصائص أصل واحد.<unk> أنت على وشك تعديل خصائص :asset_count الأصول.',
'checkedout_to' => 'تم الاخراج إلى',
'checkout_date' => 'تاريخ الاخراج',
'checkin_date' => 'تاريخ الادخال',

View file

@ -12,6 +12,7 @@ return [
'clone' => 'استنساخ الأصل',
'deployable' => 'قابل للتوزيع',
'deleted' => 'تم حذف هذا الأصل.',
'delete_confirm' => 'Are you sure you want to delete this asset?',
'edit' => 'تعديل الأصل',
'model_deleted' => 'تم حذف موديل الأصول هذا. يجب استعادة الموديل قبل أن تتمكن من استعادة الأصل.',
'model_invalid' => 'The Model of this Asset is invalid.',
@ -19,7 +20,7 @@ return [
'requestable' => 'قابل للطلب',
'requested' => 'تم الطلب',
'not_requestable' => 'Not Requestable',
'requestable_status_warning' => 'Do not change requestable status',
'requestable_status_warning' => 'Do not change requestable status',
'restore' => 'استعادة الأصل',
'pending' => 'قيد الانتظار',
'undeployable' => 'غير قابل للتوزيع',
@ -45,4 +46,5 @@ return [
'alert_details' => 'Please see below for details.',
'custom_export' => 'Custom Export',
'mfg_warranty_lookup' => ':manufacturer Warranty Status Lookup',
'user_department' => 'User Department',
];

View file

@ -3,7 +3,7 @@
return array(
'does_not_exist' => 'الموديل غير موجود.',
'no_association' => 'غير مرتبط بنموذج.',
'no_association' => 'تحذير! نموذج الأصول لهذا العنصر غير صالح أو مفقود!',
'no_association_fix' => 'سيؤدي هذا إلى كسر الأمور بطرق غريبة وفظيعة. قم بتعديل هذا الأصل الآن لربطه بنموذج.',
'assoc_users' => 'هذا الموديل مرتبط حاليا بواحد أو أكثر من الأصول ولا يمكن حذفه. يرجى حذف الأصول، ثم محاولة الحذف مرة أخرى. ',

View file

@ -23,7 +23,7 @@ return [
'help' => [
'undeployable' => 'لا يمكن اخراج هذه الأصول لأي شخص.',
'deployable' => 'These assets can be checked out. Once they are assigned, they will assume a meta status of <i class="fas fa-circle text-blue"></i> <strong>Deployed</strong>.',
'deployable' => 'يمكن اخراج هذه الأصول. بعد تعيينهم، سيتم اعطاءها الحالة <i class="fas fa-circle text-blue"></i> <strong>تم التوزيع</strong>.',
'archived' => 'لا اخراج هذه الأصول، ولن تظهر إلا في المؤرشفة. وهذا مفيد للاحتفاظ بالمعلومات عن الأصول لأغراض الميزانية / التاريخية وايضا الاحتفاظ بها خارج قائمة الأصول اليومية.',
'pending' => 'لا يمكن بعد اخراج هذه الأصول لأي شخص، غالبا ما تستخدم للأصول اللتي قيد الصيانة، ولكن من المتوقع أن تعود إلى الاستخدام.',
],

View file

@ -3,7 +3,7 @@
return [
'accessories' => 'ملحقات',
'activated' => 'مفعل',
'accepted_date' => 'Date Accepted',
'accepted_date' => 'تم تخزين التاريخ',
'accessory' => 'ملحق',
'accessory_report' => 'تقرير الملحقات',
'action' => 'الإجراء',
@ -12,7 +12,7 @@ return [
'admin' => 'الإدارة',
'administrator' => 'المدير',
'add_seats' => 'المقاعد المضافة',
'age' => "Age",
'age' => "العمر",
'all_assets' => 'كل الأصول',
'all' => 'الكل',
'archived' => 'مؤرشفة',
@ -264,7 +264,7 @@ return [
'accept_eula' => 'اتفاقية القبول',
'supplier' => 'المورد',
'suppliers' => 'الموردون',
'sure_to_delete' => 'هل تريد بالتأكيد حذفها',
'sure_to_delete' => 'هل تريد بالتأكيد حذفها',
'submit' => 'عرض',
'target' => 'استهداف',
'time_and_date_display' => 'عرض الوقت والتاريخ',
@ -368,8 +368,8 @@ return [
'notification_warning' => 'Warning:',
'notification_info' => 'Info:',
'asset_information' => 'Asset Information',
'model_name' => 'Model Name:',
'asset_name' => 'Asset Name:',
'model_name' => 'Model Name',
'asset_name' => 'Asset Name',
'consumable_information' => 'Consumable Information:',
'consumable_name' => 'Consumable Name:',
'accessory_information' => 'Accessory Information:',
@ -413,7 +413,7 @@ return [
'integration_option' => 'Integration Option',
'log_does_not_exist' => 'No matching log record exists.',
'merge_users' => 'دمج المستخدمين',
'merge_information' => 'سيؤدي هذا إلى دمج :count مستخدمين في مستخدم واحد. حدد المستخدم الذي ترغب في دمج بقية المستخدمين بالأسفل، والأصول المرتبطة ، والتراخيص ، إلخ سيتم نقلها إلى المستخدم المحدد وسيتم وضع علامة على المستخدمين الآخرين كمحذوفين.',
'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licenses, etc will be moved over to the selected user and the other users will be marked as deleted.',
'warning_merge_information' => 'لا يمكن التراجع عن هذا الإجراء، ويجب أن تستخدم فقط عندما تحتاج إلى دمج المستخدمين بسبب سوء الاستيراد أو المزامنة. تأكد من تشغيل النسخ الاحتياطي أولاً.',
'no_users_selected' => 'لا يوجد مستخدمين محددين',
'not_enough_users_selected' => 'يجب اختيارعدد :count مستخدم على الأقل',
@ -436,6 +436,7 @@ return [
'errors_importing' => 'Some Errors occurred while importing: ',
'warning' => 'WARNING: :warning',
'success_redirecting' => '"Success... Redirecting.',
'cancel_request' => 'Cancel this item request',
'setup_successful_migrations' => 'تم إنشاء جداول قاعدة البيانات الخاصة بك',
'setup_migration_output' => 'ناتج الهجرة:',
'setup_migration_create_user' => 'التالي: إنشاء مستخدم',
@ -448,5 +449,30 @@ return [
'modal_confirm_generic' => 'Are you sure?',
'cannot_be_deleted' => 'This item cannot be deleted',
'undeployable_tooltip' => 'This item cannot be checked out. Check the quantity remaining.',
'serial_number' => 'Serial Number',
'item_notes' => ':item Notes',
'item_name_var' => ':item Name',
'importer' => [
'checked_out_to_fullname' => 'Checked Out to: Full Name',
'checked_out_to_first_name' => 'Checked Out to: First Name',
'checked_out_to_last_name' => 'Checked Out to: Last Name',
'checked_out_to_username' => 'Checked Out to: Username',
'checked_out_to_email' => 'Checked Out to: Email',
'checked_out_to_tag' => 'Checked Out to: Asset Tag',
'manager_first_name' => 'Manager First Name',
'manager_last_name' => 'Manager Last Name',
'manager_full_name' => 'Manager Full Name',
'manager_username' => 'Manager Username',
'checkout_type' => 'Checkout Type',
'checkout_location' => 'Checkout to Location',
'image_filename' => 'Image Filename',
'do_not_import' => 'Do Not Import',
'vip' => 'VIP',
'avatar' => 'Avatar',
'gravatar' => 'Gravatar Email',
'currency' => 'Currency',
'address2' => 'Address Line 2',
'import_note' => 'Imported using csv importer',
],
];

View file

@ -8,6 +8,8 @@ return array(
'clone' => 'Копиране на категория',
'create' => 'Създаване на категория',
'edit' => 'Редакция на категория',
'email_will_be_sent_due_to_global_eula' => 'An email will be sent to the user because the global EULA is being used.',
'email_will_be_sent_due_to_category_eula' => 'An email will be sent to the user because a EULA is set for this category.',
'eula_text' => 'Категория EULA',
'eula_text_help' => 'Това поле позволява да задавате различни EULA за всеки тип активи. Ако имате обща EULA за всички активи, можете да използвате кутийката по-долу за да използвате една обща по подразбиране.',
'name' => 'Име на категория',

View file

@ -14,7 +14,7 @@ return array(
'update' => array(
'error' => 'Категорията не беше обновена. Моля опитайте отново',
'success' => 'Категорията е обновена успешно.',
'cannot_change_category_type' => 'You cannot change the category type once it has been created',
'cannot_change_category_type' => 'Не може да смените вида на категорията след като е създадена',
),
'delete' => array(

View file

@ -51,4 +51,7 @@ return [
'display_in_user_view_table' => 'Visible to User',
'auto_add_to_fieldsets' => 'Automatically add this to every new fieldset',
'add_to_preexisting_fieldsets' => 'Add to any existing fieldsets',
'show_in_listview' => 'Show in list views by default. Authorized users will still be able to show/hide via the column selector.',
'show_in_listview_short' => 'Show in lists',
];

View file

@ -2,7 +2,7 @@
return [
'bulk_delete' => 'Потвърдете масовото изтриване на активи',
'bulk_restore' => 'Confirm Bulk Restore Assets',
'bulk_restore' => 'Потвърдете масовото възстановяване на активите',
'bulk_delete_help' => 'Прегледайте активите, маркирани за масово изтриване. Веднъж изтрити, активите могат да бъдат възстановени, но те вече няма да бъдат асоциирани с потребителите, на които са изписани в момента.',
'bulk_restore_help' => 'Review the assets for bulk restoration below. Once restored, these assets will not be associated with any users they were previously assigned to.',
'bulk_delete_warn' => 'Ще бъдат изтрити :asset_count актива.',

View file

@ -12,6 +12,7 @@ return [
'clone' => 'Копиране на актив',
'deployable' => 'Може да бъде предоставен',
'deleted' => 'Този актив беше изтрит.',
'delete_confirm' => 'Are you sure you want to delete this asset?',
'edit' => 'Редакция на актив',
'model_deleted' => 'Този Модел на актив беше изтрит. Вие трябва да възстановите този модел преди да можете да възстановите актива.',
'model_invalid' => 'The Model of this Asset is invalid.',
@ -19,7 +20,7 @@ return [
'requestable' => 'Може да бъде изискван',
'requested' => 'Изискан',
'not_requestable' => 'Не може да бъде изискан',
'requestable_status_warning' => 'Да не се сменя статуса за изискване',
'requestable_status_warning' => 'Do not change requestable status',
'restore' => 'Възстановяване на актив',
'pending' => 'Предстоящ',
'undeployable' => 'Не може да бъде предоставян',
@ -45,4 +46,5 @@ return [
'alert_details' => 'Please see below for details.',
'custom_export' => 'Custom Export',
'mfg_warranty_lookup' => ':manufacturer Warranty Status Lookup',
'user_department' => 'User Department',
];

View file

@ -33,8 +33,8 @@ return [
'asset_checked_out' => 'Изписано на',
'asset_expected_checkin' => 'Очаквана дата на вписване',
'date' => 'Дата:',
'signed_by_asset_auditor' => 'Signed By (Asset Auditor):',
'signed_by_finance_auditor' => 'Signed By (Finance Auditor):',
'signed_by_location_manager' => 'Signed By (Location Manager):',
'signed_by' => 'Signed Off By:',
'signed_by_asset_auditor' => 'Подписан от (проверяващ):',
'signed_by_finance_auditor' => 'Подписан от (счетоводител):',
'signed_by_location_manager' => 'Подписан от (мениджър):',
'signed_by' => 'Подписано от:',
];

View file

@ -3,8 +3,8 @@
return array(
'does_not_exist' => 'Моделът не съществува.',
'no_association' => 'NO MODEL ASSOCIATED.',
'no_association_fix' => 'This will break things in weird and horrible ways. Edit this asset now to assign it a model.',
'no_association' => 'WARNING! The asset model for this item is invalid or missing!',
'no_association_fix' => 'Това ще счупи нещата по много лош начин. Редактирайте артикула сега и го зачислете към модел.',
'assoc_users' => 'Този модел е асоцииран с един или повече активи и не може да бъде изтрит. Моля изтрийте активите и опитайте отново.',
@ -32,14 +32,14 @@ return array(
'bulkedit' => array(
'error' => 'Няма полета, който да са се променили, така че нищо не е осъвременено.',
'success' => 'Model successfully updated. |:model_count models successfully updated.',
'warn' => 'You are about to update the properies of the following model: |You are about to edit the properties of the following :model_count models:',
'success' => 'Модела е обновен успешно. |:model_count модела са обновени успешно.',
'warn' => 'Вие ще обновите характиристиките на следния модел: |Вие ще редактирате характеристиките на следните :model_count модела:',
),
'bulkdelete' => array(
'error' => 'Няма избрани модели, така че нищо не бе изтрито.',
'success' => 'Model deleted!|:success_count models deleted!',
'success' => 'Модела е изтрит!|:success_count модела бяха изтрити!',
'success_partial' => ':success_count модела бяха изтрити, но :fail_count не бяха, тъй като към тях има асоциирани активи.'
),

View file

@ -264,7 +264,7 @@ return [
'accept_eula' => 'Acceptance Agreement',
'supplier' => 'Доставчик',
'suppliers' => 'Доставчици',
'sure_to_delete' => 'Сигурни ли сте, че искате да изтриете',
'sure_to_delete' => 'Сигурни ли сте, че искате да изтриете',
'submit' => 'Изпрати',
'target' => 'Цел',
'time_and_date_display' => 'Показване на време и дата',
@ -368,8 +368,8 @@ return [
'notification_warning' => 'Warning:',
'notification_info' => 'Info:',
'asset_information' => 'Asset Information',
'model_name' => 'Model Name:',
'asset_name' => 'Asset Name:',
'model_name' => 'Model Name',
'asset_name' => 'Asset Name',
'consumable_information' => 'Consumable Information:',
'consumable_name' => 'Consumable Name:',
'accessory_information' => 'Accessory Information:',
@ -413,7 +413,7 @@ return [
'integration_option' => 'Integration Option',
'log_does_not_exist' => 'No matching log record exists.',
'merge_users' => 'Merge Users',
'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licences, etc will be moved over to the selected user and the other users will be marked as deleted.',
'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licenses, etc will be moved over to the selected user and the other users will be marked as deleted.',
'warning_merge_information' => 'This action CANNOT be undone and should ONLY be used when you need to merge users because of a bad import or sync. Be sure to run a backup first.',
'no_users_selected' => 'No users selected',
'not_enough_users_selected' => 'At least :count users must be selected',
@ -436,6 +436,7 @@ return [
'errors_importing' => 'Some Errors occurred while importing: ',
'warning' => 'WARNING: :warning',
'success_redirecting' => '"Success... Redirecting.',
'cancel_request' => 'Отмени тази заявка за артикул',
'setup_successful_migrations' => 'Your database tables have been created',
'setup_migration_output' => 'Migration output:',
'setup_migration_create_user' => 'Next: Create User',
@ -448,5 +449,30 @@ return [
'modal_confirm_generic' => 'Are you sure?',
'cannot_be_deleted' => 'This item cannot be deleted',
'undeployable_tooltip' => 'This item cannot be checked out. Check the quantity remaining.',
'serial_number' => 'Serial Number',
'item_notes' => ':item Notes',
'item_name_var' => ':item Name',
'importer' => [
'checked_out_to_fullname' => 'Checked Out to: Full Name',
'checked_out_to_first_name' => 'Checked Out to: First Name',
'checked_out_to_last_name' => 'Checked Out to: Last Name',
'checked_out_to_username' => 'Checked Out to: Username',
'checked_out_to_email' => 'Checked Out to: Email',
'checked_out_to_tag' => 'Checked Out to: Asset Tag',
'manager_first_name' => 'Manager First Name',
'manager_last_name' => 'Manager Last Name',
'manager_full_name' => 'Manager Full Name',
'manager_username' => 'Manager Username',
'checkout_type' => 'Checkout Type',
'checkout_location' => 'Checkout to Location',
'image_filename' => 'Image Filename',
'do_not_import' => 'Do Not Import',
'vip' => 'VIP',
'avatar' => 'Avatar',
'gravatar' => 'Gravatar Email',
'currency' => 'Currency',
'address2' => 'Address Line 2',
'import_note' => 'Imported using csv importer',
],
];

View file

@ -2,7 +2,7 @@
return [
'select_language' => 'Select a language',
'select_language' => 'Избор на език',
'languages' => [
'en'=> 'English, US',
'en-GB'=> 'English, UK',

View file

@ -1,8 +1,8 @@
<?php
return [
'acceptance_asset_accepted' => 'A user has accepted an item',
'acceptance_asset_declined' => 'A user has declined an item',
'acceptance_asset_accepted' => 'Потребителя прие актива',
'acceptance_asset_declined' => 'Потребителя отказа актива',
'a_user_canceled' => 'Потребител е отменил заявка за елемент в уебсайта',
'a_user_requested' => 'Потребител е направил заявка за елемент в уебсайта',
'accessory_name' => 'Име на аксесоар:',
@ -11,7 +11,7 @@ return [
'asset' => 'Актив:',
'asset_name' => 'Име на актив:',
'asset_requested' => 'Заявка за актив',
'asset_tag' => 'Етикет на актив',
'asset_tag' => 'Инвентарен номер',
'assigned_to' => 'Възложени на',
'best_regards' => 'С най-добри пожелания.',
'canceled' => 'Отменено:',
@ -43,10 +43,10 @@ return [
'login_first_admin' => 'Влезте в своята Snipe-IT инсталация използвайки данните по-долу:',
'login' => 'Вход:',
'Low_Inventory_Report' => 'Доклад за нисък запас',
'inventory_report' => 'Inventory Report',
'inventory_report' => 'Списък активи',
'min_QTY' => 'Минимално количество',
'name' => 'Име',
'new_item_checked' => 'Нов артикул беше изписан под вашете име, детайлите са отдолу.',
'new_item_checked' => 'Нов артикул беше изписан под вашето име, детайлите са отдолу.',
'password' => 'Парола:',
'password_reset' => 'Нулиране на паролата',
@ -74,11 +74,11 @@ return [
'your_credentials' => 'Вашите идентификационни данни за Snipe-IT',
'Accessory_Checkin_Notification' => 'Аксесоарат е вписан',
'Asset_Checkin_Notification' => 'Актива е вписан',
'Asset_Checkout_Notification' => 'Asset checked out',
'Asset_Checkout_Notification' => 'Актива е изписан',
'License_Checkin_Notification' => 'Лиценза е вписан',
'Expected_Checkin_Report' => 'Очакван рапорт за вписване на актив',
'Expected_Checkin_Notification' => 'Напомняне: :name крайната дата за вписване наближава',
'Expected_Checkin_Date' => 'Наближава срока за връщане на актив който е заведен на Вас, трябва да се върна на :date',
'your_assets' => 'Преглед на вашите активи',
'rights_reserved' => 'All rights reserved.',
'rights_reserved' => 'Всички права запазени.',
];

View file

@ -43,14 +43,14 @@ return [
'file' => 'Атрибутът: трябва да е файл.',
'filled' => 'Полето на атрибута: трябва да има стойност.',
'image' => ':attribute трябва да бъде изображение.',
'import_field_empty' => 'The value for :fieldname cannot be null.',
'import_field_empty' => 'Стойността за :fieldname не може да бъде празна.',
'in' => 'Избраният :attribute е невалиден.',
'in_array' => 'Полето: atribut не съществува в: други.',
'integer' => ':attribute трябва да бъде целочислен.',
'ip' => ':attribute трябва да бъде валиден IP адрес.',
'ipv4' => 'Атрибутът: трябва да е валиден IPv4 адрес.',
'ipv6' => 'Атрибутът: трябва да е валиден IPv6 адрес.',
'is_unique_department' => 'The :attribute must be unique to this Company Location',
'is_unique_department' => ':attribute трябва да бъде уникален за тази локация на фирмата.',
'json' => 'Атрибутът: трябва да е валиден низ на JSON.',
'max' => [
'numeric' => ':attribute не може да бъде по-дълъг от :max.',
@ -66,8 +66,8 @@ return [
'string' => ':attribute трябва да бъде минимум :min символа.',
'array' => 'Атрибутът: трябва да има поне: min елементи.',
],
'starts_with' => 'The :attribute must start with one of the following: :values.',
'ends_with' => 'The :attribute must end with one of the following: :values.',
'starts_with' => ':attribute трябва да започва с една от следните стойности: :values',
'ends_with' => ':attribute трябва да завършва с една от следните стойности: :values',
'not_in' => 'Избраният :attribute е невалиден.',
'numeric' => ':attribute трябва да бъде число.',
@ -95,13 +95,13 @@ return [
'url' => 'Форматът на :attribute е невалиден.',
'unique_undeleted' => ':attribute трябва да бъде уникален.',
'non_circular' => ':attribute не трябва да създава препрадка към себе си.',
'disallow_same_pwd_as_user_fields' => 'Password cannot be the same as the username.',
'letters' => 'Password must contain at least one letter.',
'numbers' => 'Password must contain at least one number.',
'case_diff' => 'Password must use mixed case.',
'symbols' => 'Password must contain symbols.',
'disallow_same_pwd_as_user_fields' => 'Паролата не може да бъде същата, като потребителското име.',
'letters' => 'Паролата трябва да съдържа поне една буква.',
'numbers' => 'Паролата трябва да съдържа поне една цифра.',
'case_diff' => 'Паролата трябва да съдържа главни и малки букви.',
'symbols' => 'Паролата трябва да съдържа символи.',
'gte' => [
'numeric' => 'Value cannot be negative'
'numeric' => 'Стойността не може да бъде отрицателна'
],
@ -126,13 +126,13 @@ return [
// date_format validation with slightly less stupid messages. It duplicates a lot, but it gets the job done :(
// We use this because the default error message for date_format is reflects php Y-m-d, which non-PHP
// people won't know how to format.
'purchase_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format',
'last_audit_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD hh:mm:ss format',
'expiration_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format',
'termination_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format',
'expected_checkin.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format',
'start_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format',
'end_date.date_format' => 'The :attribute must be a valid date in YYYY-MM-DD format',
'purchase_date.date_format' => ':values трябва да бъде валидна дата в YYYY-MM-DD формат',
'last_audit_date.date_format' => ':attribute трябва да бъде валидна дата в YYYY-MM-DD hh:mm:ss формат',
'expiration_date.date_format' => ':attribute трябва да бъде валидна дата в YYYY-MM-DD формат',
'termination_date.date_format' => ':attribute трябва да бъде валидна дата в YYYY-MM-DD формат',
'expected_checkin.date_format' => ':attribute трябва да бъде валидна дата в YYYY-MM-DD формат',
'start_date.date_format' => ':attribute трябва да бъде валидна дата в YYYY-MM-DD формат',
'end_date.date_format' => ':attribute трябва да бъде валидна дата в YYYY-MM-DD формат',
],

View file

@ -8,6 +8,8 @@ return array(
'clone' => 'Clone Category',
'create' => 'Create Category',
'edit' => 'Edit Category',
'email_will_be_sent_due_to_global_eula' => 'An email will be sent to the user because the global EULA is being used.',
'email_will_be_sent_due_to_category_eula' => 'An email will be sent to the user because a EULA is set for this category.',
'eula_text' => 'Category EULA',
'eula_text_help' => 'This field allows you to customize your EULAs for specific types of assets. If you only have one EULA for all of your assets, you can check the box below to use the primary default.',
'name' => 'Category Name',

View file

@ -51,4 +51,7 @@ return [
'display_in_user_view_table' => 'Visible to User',
'auto_add_to_fieldsets' => 'Automatically add this to every new fieldset',
'add_to_preexisting_fieldsets' => 'Add to any existing fieldsets',
'show_in_listview' => 'Show in list views by default. Authorized users will still be able to show/hide via the column selector.',
'show_in_listview_short' => 'Show in lists',
];

View file

@ -12,6 +12,7 @@ return [
'clone' => 'Clone Asset',
'deployable' => 'Deployable',
'deleted' => 'This asset has been deleted.',
'delete_confirm' => 'Are you sure you want to delete this asset?',
'edit' => 'Edit Asset',
'model_deleted' => 'This Assets model has been deleted. You must restore the model before you can restore the Asset.',
'model_invalid' => 'The Model of this Asset is invalid.',
@ -19,7 +20,7 @@ return [
'requestable' => 'Requestable',
'requested' => 'Requested',
'not_requestable' => 'Not Requestable',
'requestable_status_warning' => 'Do not change requestable status',
'requestable_status_warning' => 'Do not change requestable status',
'restore' => 'Restore Asset',
'pending' => 'Pending',
'undeployable' => 'Undeployable',
@ -45,4 +46,5 @@ return [
'alert_details' => 'Please see below for details.',
'custom_export' => 'Custom Export',
'mfg_warranty_lookup' => ':manufacturer Warranty Status Lookup',
'user_department' => 'User Department',
];

View file

@ -3,7 +3,7 @@
return array(
'does_not_exist' => 'Model does not exist.',
'no_association' => 'NO MODEL ASSOCIATED.',
'no_association' => 'WARNING! The asset model for this item is invalid or missing!',
'no_association_fix' => 'This will break things in weird and horrible ways. Edit this asset now to assign it a model.',
'assoc_users' => 'This model is currently associated with one or more assets and cannot be deleted. Please delete the assets, and then try deleting again. ',

View file

@ -264,7 +264,7 @@ return [
'accept_eula' => 'Acceptance Agreement',
'supplier' => 'Supplier',
'suppliers' => 'Suppliers',
'sure_to_delete' => 'Are you sure you wish to delete',
'sure_to_delete' => 'Are you sure you wish to delete',
'submit' => 'Submit',
'target' => 'Target',
'time_and_date_display' => 'Time and Date Display',
@ -368,8 +368,8 @@ return [
'notification_warning' => 'Warning:',
'notification_info' => 'Info:',
'asset_information' => 'Asset Information',
'model_name' => 'Model Name:',
'asset_name' => 'Asset Name:',
'model_name' => 'Model Name',
'asset_name' => 'Asset Name',
'consumable_information' => 'Consumable Information:',
'consumable_name' => 'Consumable Name:',
'accessory_information' => 'Accessory Information:',
@ -413,7 +413,7 @@ return [
'integration_option' => 'Integration Option',
'log_does_not_exist' => 'No matching log record exists.',
'merge_users' => 'Merge Users',
'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licences, etc will be moved over to the selected user and the other users will be marked as deleted.',
'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licenses, etc will be moved over to the selected user and the other users will be marked as deleted.',
'warning_merge_information' => 'This action CANNOT be undone and should ONLY be used when you need to merge users because of a bad import or sync. Be sure to run a backup first.',
'no_users_selected' => 'No users selected',
'not_enough_users_selected' => 'At least :count users must be selected',
@ -436,6 +436,7 @@ return [
'errors_importing' => 'Some Errors occurred while importing: ',
'warning' => 'WARNING: :warning',
'success_redirecting' => '"Success... Redirecting.',
'cancel_request' => 'Cancel this item request',
'setup_successful_migrations' => 'Your database tables have been created',
'setup_migration_output' => 'Migration output:',
'setup_migration_create_user' => 'Next: Create User',
@ -448,5 +449,30 @@ return [
'modal_confirm_generic' => 'Are you sure?',
'cannot_be_deleted' => 'This item cannot be deleted',
'undeployable_tooltip' => 'This item cannot be checked out. Check the quantity remaining.',
'serial_number' => 'Serial Number',
'item_notes' => ':item Notes',
'item_name_var' => ':item Name',
'importer' => [
'checked_out_to_fullname' => 'Checked Out to: Full Name',
'checked_out_to_first_name' => 'Checked Out to: First Name',
'checked_out_to_last_name' => 'Checked Out to: Last Name',
'checked_out_to_username' => 'Checked Out to: Username',
'checked_out_to_email' => 'Checked Out to: Email',
'checked_out_to_tag' => 'Checked Out to: Asset Tag',
'manager_first_name' => 'Manager First Name',
'manager_last_name' => 'Manager Last Name',
'manager_full_name' => 'Manager Full Name',
'manager_username' => 'Manager Username',
'checkout_type' => 'Checkout Type',
'checkout_location' => 'Checkout to Location',
'image_filename' => 'Image Filename',
'do_not_import' => 'Do Not Import',
'vip' => 'VIP',
'avatar' => 'Avatar',
'gravatar' => 'Gravatar Email',
'currency' => 'Currency',
'address2' => 'Address Line 2',
'import_note' => 'Imported using csv importer',
],
];

View file

@ -8,6 +8,8 @@ return array(
'clone' => 'Klonovat Kategorii',
'create' => 'Vytvořit kategorii',
'edit' => 'Upravit Kategorii',
'email_will_be_sent_due_to_global_eula' => 'An email will be sent to the user because the global EULA is being used.',
'email_will_be_sent_due_to_category_eula' => 'An email will be sent to the user because a EULA is set for this category.',
'eula_text' => 'EULA Kategorie',
'eula_text_help' => 'Toto pole umožňuje upravit EULA pro různé druhy majetku. Pokud máte pouze jeden typ pro všechen majetek, můžete zaškrtnout položku níže pro použití jako výchozí.',
'name' => 'Název kategorie',

View file

@ -51,4 +51,7 @@ return [
'display_in_user_view_table' => 'Viditelné pro uživatele',
'auto_add_to_fieldsets' => 'Automatically add this to every new fieldset',
'add_to_preexisting_fieldsets' => 'Add to any existing fieldsets',
'show_in_listview' => 'Show in list views by default. Authorized users will still be able to show/hide via the column selector.',
'show_in_listview_short' => 'Show in lists',
];

View file

@ -2,11 +2,11 @@
return [
'bulk_delete' => 'Potvrzení hromadného odstranění majetku',
'bulk_restore' => 'Confirm Bulk Restore Assets',
'bulk_restore' => 'Potvrzení hromadného obnovení majetku',
'bulk_delete_help' => 'Zkontrolujte seznam odstraňovaného majetku níže. Jakmile jej potvrdíte, nebude možné tento majetek obnovit a budou zrušeny i vazby na uživatele, kteří jej měli v držení.',
'bulk_restore_help' => 'Review the assets for bulk restoration below. Once restored, these assets will not be associated with any users they were previously assigned to.',
'bulk_restore_help' => 'Níže zkontrolujte majetek před jeho hromadnou obnovou. Po obnovení nebude majetek spojen s žádnými uživateli, kterým byl dříve přidělen.',
'bulk_delete_warn' => 'Chystáte se odstranit :asset_count položek majetku.',
'bulk_restore_warn' => 'You are about to restore :asset_count assets.',
'bulk_restore_warn' => 'Chystáte se obnovit :asset_count položek majetku.',
'bulk_update' => 'Hromadná aktualizace majetku',
'bulk_update_help' => 'Tento formulář umožňuje hromadnou editaci majetku. Vyplňte pouze položky, které chcete změnit. Jakékoliv prázné položky zůstanou nezměněny. ',
'bulk_update_warn' => 'Chystáte se upravit vlastnosti 1 položky.|Chystáte se upravit vlastnosti :asset_count položek.',
@ -48,7 +48,7 @@ return [
'asset_location_update_default' => 'Aktualizovat pouze výchozí umístění',
'asset_not_deployable' => 'Tento majetek nelze vyskladnit.',
'asset_deployable' => 'Tento majetek lze vyskladnit.',
'processing_spinner' => 'Processing... (This might take a bit of time on large files)',
'processing_spinner' => 'Zpracovávání... (S velkými soubory to může chvíli trvat)',
'optional_infos' => 'Volitelné informace',
'order_details' => 'Informace související s objednávkou'
];

View file

@ -12,6 +12,7 @@ return [
'clone' => 'Klonovat majetek',
'deployable' => 'Připraveno k nasazení',
'deleted' => 'Tento majetek byl odstraněn.',
'delete_confirm' => 'Are you sure you want to delete this asset?',
'edit' => 'Upravit majetek',
'model_deleted' => 'Tento model majetku byl odstraněn. Před obnovením majetku musíte model obnovit.',
'model_invalid' => 'Model tohoto majetku je neplatný.',
@ -19,11 +20,11 @@ return [
'requestable' => 'Lze vyžádat',
'requested' => 'Požadováno',
'not_requestable' => 'Nelze vyžádat',
'requestable_status_warning' => 'Neměnit požadovaný stav',
'requestable_status_warning' => 'Neměnit stav K vyžádání',
'restore' => 'Obnovit zařízení',
'pending' => 'Čekající',
'undeployable' => 'Nelze vyskladnit',
'undeployable_tooltip' => 'This asset has a status label that is undeployable and cannot be checked out at this time.',
'undeployable_tooltip' => 'Tento majetek je ve stavu, který neumožňuje nasazení, a nemůže tak být vydán.',
'view' => 'Zobrazit majetek',
'csv_error' => 'Máte chybu v souboru CSV:',
'import_text' => '
@ -44,5 +45,6 @@ return [
'success_messages' => 'Úspěšné zprávy:',
'alert_details' => 'Podrobnosti naleznete níže.',
'custom_export' => 'Uživatelsky definovaný export',
'mfg_warranty_lookup' => ':manufacturer Warranty Status Lookup',
'mfg_warranty_lookup' => 'Vyhledávání stavu záruky :manufacturer',
'user_department' => 'Oddělení',
];

View file

@ -23,8 +23,8 @@ return [
'restore' => [
'error' => 'Majetek se nepodařilo obnovit, zkuste to prosím později',
'success' => 'Majetek byl v pořádku obnoven.',
'bulk_success' => 'Asset restored successfully.',
'nothing_updated' => 'No assets were selected, so nothing was restored.',
'bulk_success' => 'Majetek byl v pořádku obnoven.',
'nothing_updated' => 'Nevybrali jste žádné položky, nic tedy nebylo obnoveno.',
],
'audit' => [

View file

@ -8,7 +8,7 @@ return [
'change' => 'Příjem/Výdej',
'checkout_date' => 'Datum vydání',
'checkoutto' => 'Vydané',
'components_cost' => 'Total Components Cost',
'components_cost' => 'Celkové náklady na součásti',
'current_value' => 'Aktuální hodnota',
'diff' => 'Rozdíl',
'dl_csv' => 'Stáhnout CSV',

View file

@ -3,7 +3,7 @@
return array(
'does_not_exist' => 'Model neexistuje.',
'no_association' => 'BEZ PŘIŘAZENÉHO MODELU.',
'no_association' => 'VAROVÁNÍ! Model majetku pro tuto položku je neplatný, nebo chybí!',
'no_association_fix' => 'Tento stav může způsobit nedozírné problémy. Přiřaďte dotyčnému majetku správný model.',
'assoc_users' => 'Tento model je spojen s alespoň jedním majetkem a nemůže být smazán. Prosím smažte tyto majetky a pak to zkuste znovu. ',
@ -32,14 +32,14 @@ return array(
'bulkedit' => array(
'error' => 'Žádné pole nebyly změněny, takže nic nebylo aktualizováno.',
'success' => 'Model successfully updated. |:model_count models successfully updated.',
'warn' => 'You are about to update the properies of the following model: |You are about to edit the properties of the following :model_count models:',
'success' => 'Model úspěšně upraven. |:model_count modelů bylo úspěšně upraveno.',
'warn' => 'Chystáte se upravit vlastnosti následujícího modelu: |Chystáte se upravit vlastnosti následujících :model_count modelů:',
),
'bulkdelete' => array(
'error' => 'Nebyly vybrány žádné modely, takže nebylo nic smazáno.',
'success' => 'Model deleted!|:success_count models deleted!',
'success' => 'Model smazán!|:success_count modelů odstraněno!',
'success_partial' => ':success_count modelů smazáno, ale :fail_count nebylo možné smazat protože pořád mají přiřazený majetek.'
),

View file

@ -6,7 +6,7 @@ return array(
'declined' => 'Úspěšně jste odmítli tento majetek.',
'bulk_manager_warn' => 'Uživatelé byli úspěšně aktualizováni, položka správce však nebyla uložena, protože správce, který jste si vybrali, byl také v seznamu uživatelů, který má být upraven, a uživatelé nemusí být jejich vlastní správce. Zvolte své uživatele znovu, kromě správce.',
'user_exists' => 'Uživatel již existuje!',
'user_not_found' => 'User does not exist.',
'user_not_found' => 'Uživatel neexistuje.',
'user_login_required' => 'Přihlašovací pole je povinné',
'user_password_required' => 'Je vyžadováno heslo.',
'insufficient_permissions' => 'Nedostatečná oprávnění.',

Some files were not shown because too many files have changed in this diff Show more