Merge branch 'develop' into snipeit_v7_laravel10

Hopefully, last merge?
This commit is contained in:
Brady Wetherington 2024-04-02 20:34:04 +01:00
commit 65e21faa3e
544 changed files with 5726 additions and 4980 deletions

View file

@ -86,6 +86,7 @@ COOKIE_DOMAIN=null
SECURE_COOKIES=false
API_TOKEN_EXPIRATION_YEARS=15
BS_TABLE_STORAGE=cookieStorage
BS_TABLE_DEEPLINK=true
# --------------------------------------------
# OPTIONAL: SECURITY HEADER SETTINGS

View file

@ -11,7 +11,8 @@ It is built on [Laravel 8](http://laravel.com).
Snipe-IT is actively developed and we [release quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](https://snipeitapp.com/demo/).)
__This is web-based software__. This means there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows, and we have a [Docker image](https://snipe-it.readme.io/docs/docker) available if that's what you're into.
> [!TIP]
> __This is web-based software__. This means there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows, and we have a [Docker image](https://snipe-it.readme.io/docs/docker) available if that's what you're into.
-----
@ -21,7 +22,7 @@ For instructions on installing and configuring Snipe-IT on your server, check ou
If you're having trouble with the installation, please check the [Common Issues](https://snipe-it.readme.io/docs/common-issues) and [Getting Help](https://snipe-it.readme.io/docs/getting-help) documentation, and search this repository's open *and* closed issues for help.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
<!-- [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) -->
-----
### User's Manual
@ -32,8 +33,9 @@ For help using Snipe-IT, check out the [user's manual](https://snipe-it.readme.i
Feel free to check out the [GitHub Issues for this project](https://github.com/snipe/snipe-it/issues) to open a bug report or see what open issues you can help with. Please search through existing issues (open *and* closed) to see if your question has already been answered before opening a new issue.
**PLEASE see the [Getting Help Guidelines](https://snipe-it.readme.io/docs/getting-help) and [Common Issues](https://snipe-it.readme.io/docs/common-issues) before opening a ticket, and be sure to complete all of the questions in the Github Issue template to help us to help you as quickly as possible.**
> [!IMPORTANT]
> **PLEASE see the [Getting Help Guidelines](https://snipe-it.readme.io/docs/getting-help) and [Common Issues](https://snipe-it.readme.io/docs/common-issues) before opening a ticket, and be sure to complete all of the questions in the Github Issue template to help us to help you as quickly as possible.**
>
-----
### Upgrading
@ -57,6 +59,9 @@ Please see the [translations documentation](https://snipe-it.readme.io/docs/tran
Since the release of the JSON REST API, several third-party developers have been developing modules and libraries to work with Snipe-IT.
> [!NOTE]
> As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :)
- [Python Module](https://github.com/jbloomer/SnipeIT-PythonAPI) by [@jbloomer](https://github.com/jbloomer)
- [SnipeSharp - .NET module in C#](https://github.com/barrycarey/SnipeSharp) by [@barrycarey](https://github.com/barrycarey)
- [InQRy -unmaintained-](https://github.com/Microsoft/InQRy) by [@Microsoft](https://github.com/Microsoft)
@ -74,8 +79,6 @@ Since the release of the JSON REST API, several third-party developers have been
- [Kandji2Snipe](https://github.com/grokability/kandji2snipe) by [@briangoldstein](https://github.com/briangoldstein) - Python script that synchronizes Kandji with Snipe-IT.
- [SnipeAgent](https://github.com/ReticentRobot/SnipeAgent) by @ReticentRobot - Windows agent for Snipe-IT
As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :)
-----
### Contributing
@ -92,4 +95,5 @@ The ERD is available [online here](https://drawsql.app/templates/snipe-it).
### Security
To report a security vulnerability, please email security@snipeitapp.com instead of using the issue tracker.
> [!IMPORTANT]
> **To report a security vulnerability, please email security@snipeitapp.com instead of using the issue tracker.**

View file

@ -0,0 +1,76 @@
<?php
namespace App\Console\Commands;
use App\Models\Asset;
use App\Models\CustomField;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class ToggleCustomfieldEncryption extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:customfield-encryption
{fieldname : the db_column_name of the field}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This command should be used to convert an unencrypted custom field into a custom field and encrypt the associated data in the assets table for that column.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$fieldname = $this->argument('fieldname');
if ($field = CustomField::where('db_column', $fieldname)->first()) {
// If the field is not encrypted, make it encrypted and encrypt the data in the assets table for the
// corresponding field.
DB::transaction(function () use ($field) {
if ($field->field_encrypted == 0) {
$assets = Asset::whereNotNull($field->db_column)->get();
foreach ($assets as $asset) {
$asset->{$field->db_column} = encrypt($asset->{$field->db_column});
$asset->save();
}
$field->field_encrypted = 1;
$field->save();
// This field is already encrypted. Do nothing.
} else {
$this->error('The custom field ' . $field->db_column.' is already encrypted. No action was taken.');
}
});
// No matching column name found
} else {
$this->error('No matching results for unencrypted custom fields with db_column name: ' . $fieldname.'. Please check the fieldname.');
}
}
}

View file

@ -842,7 +842,7 @@ class Helper
$filetype = @finfo_file($finfo, $file);
finfo_close($finfo);
if (($filetype == 'image/jpeg') || ($filetype == 'image/jpg') || ($filetype == 'image/png') || ($filetype == 'image/bmp') || ($filetype == 'image/gif')) {
if (($filetype == 'image/jpeg') || ($filetype == 'image/jpg') || ($filetype == 'image/png') || ($filetype == 'image/bmp') || ($filetype == 'image/gif') || ($filetype == 'image/avif')) {
return $filetype;
}
@ -1106,6 +1106,8 @@ class Helper
'jpeg' => 'far fa-image',
'gif' => 'far fa-image',
'png' => 'far fa-image',
'webp' => 'far fa-image',
'avif' => 'far fa-image',
// word
'doc' => 'far fa-file-word',
'docx' => 'far fa-file-word',
@ -1141,6 +1143,8 @@ class Helper
case 'jpeg':
case 'gif':
case 'png':
case 'webp':
case 'avif':
return true;
break;
default:

View file

@ -94,6 +94,7 @@ class AssetsController extends Controller
'serial',
'model_number',
'last_checkout',
'last_checkin',
'notes',
'expected_checkin',
'order_number',
@ -591,6 +592,11 @@ class AssetsController extends Controller
}
}
}
if ($field->element == 'checkbox') {
if(is_array($field_val)) {
$field_val = implode(',', $field_val);
}
}
$asset->{$field->db_column} = $field_val;
@ -614,6 +620,8 @@ class AssetsController extends Controller
}
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.create.success')));
return response()->json(Helper::formatStandardApiResponse('success', (new AssetsTransformer)->transformAsset($asset), trans('admin/hardware/message.create.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $asset->getErrors()), 200);
@ -659,13 +667,22 @@ class AssetsController extends Controller
// Update custom fields
if (($model) && (isset($model->fieldset))) {
foreach ($model->fieldset->fields as $field) {
$field_val = $request->input($field->db_column, null);
if ($request->has($field->db_column)) {
if ($field->field_encrypted == '1') {
if (Gate::allows('admin')) {
$asset->{$field->db_column} = \Crypt::encrypt($request->input($field->db_column));
$asset->{$field->db_column} = Crypt::encrypt($field_val);
}
} else {
$asset->{$field->db_column} = $request->input($field->db_column);
}
if ($field->element == 'checkbox') {
if(is_array($field_val)) {
$field_val = implode(',', $field_val);
$asset->{$field->db_column} = $field_val;
}
}
else {
$asset->{$field->db_column} = $field_val;
}
}
}
@ -693,6 +710,7 @@ class AssetsController extends Controller
}
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.update.success')));
return response()->json(Helper::formatStandardApiResponse('success', (new AssetsTransformer)->transformAsset($asset), trans('admin/hardware/message.update.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $asset->getErrors()), 200);
@ -1062,8 +1080,7 @@ class AssetsController extends Controller
$assets = Asset::select('assets.*')
->with('location', 'assetstatus', 'assetlog', 'company','assignedTo',
'model.category', 'model.manufacturer', 'model.fieldset', 'supplier', 'requests')
->requestableAssets();
'model.category', 'model.manufacturer', 'model.fieldset', 'supplier', 'requests');
@ -1101,6 +1118,7 @@ class AssetsController extends Controller
break;
}
$assets->requestableAssets();
// Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $assets->count()) ? $assets->count() : app('api_offset_value');

View file

@ -235,7 +235,13 @@ class LocationsController extends Controller
public function destroy($id)
{
$this->authorize('delete', Location::class);
$location = Location::findOrFail($id);
$location = Location::withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('rtd_assets as rtd_assets_count')
->withCount('children as children_count')
->withCount('users as users_count')
->findOrFail($id);
if (! $location->isDeletable()) {
return response()
->json(Helper::formatStandardApiResponse('error', null, trans('admin/companies/message.assoc_users')));

View file

@ -32,19 +32,26 @@ class ReportsController extends Controller
}
if (($request->filled('item_type')) && ($request->filled('item_id'))) {
$actionlogs = $actionlogs->where('item_id', '=', $request->input('item_id'))
$actionlogs = $actionlogs->where(function($query) use ($request)
{
$query->where('item_id', '=', $request->input('item_id'))
->where('item_type', '=', 'App\\Models\\'.ucwords($request->input('item_type')))
->orWhere(function($query) use ($request)
{
$query->where('target_id', '=', $request->input('item_id'))
->where('target_type', '=', 'App\\Models\\'.ucwords($request->input('item_type')));
});
});
}
if ($request->filled('action_type')) {
$actionlogs = $actionlogs->where('action_type', '=', $request->input('action_type'))->orderBy('created_at', 'desc');
}
if ($request->filled('user_id')) {
$actionlogs = $actionlogs->where('user_id', '=', $request->input('user_id'));
}
if ($request->filled('action_source')) {
$actionlogs = $actionlogs->where('action_source', '=', $request->input('action_source'))->orderBy('created_at', 'desc');
}

View file

@ -563,7 +563,26 @@ class UsersController extends Controller
{
$this->authorize('view', User::class);
$this->authorize('view', Asset::class);
$assets = Asset::where('assigned_to', '=', $id)->where('assigned_type', '=', User::class)->with('model')->get();
$assets = Asset::where('assigned_to', '=', $id)->where('assigned_type', '=', User::class)->with('model');
// Filter on category ID
if ($request->filled('category_id')) {
$assets = $assets->InCategory($request->input('category_id'));
}
// Filter on model ID
if ($request->filled('model_id')) {
$model_ids = $request->input('model_id');
if (!is_array($model_ids)) {
$model_ids = array($model_ids);
}
$assets = $assets->InModelList($model_ids);
}
$assets = $assets->get();
return (new AssetsTransformer)->transformAssets($assets, $assets->count(), $request);
}
@ -664,7 +683,17 @@ class UsersController extends Controller
$user = User::find($request->get('id'));
$user->two_factor_secret = null;
$user->two_factor_enrolled = 0;
$user->save();
$user->saveQuietly();
// Log the reset
$logaction = new Actionlog();
$logaction->target_type = User::class;
$logaction->target_id = $user->id;
$logaction->item_type = User::class;
$logaction->item_id = $user->id;
$logaction->created_at = date('Y-m-d H:i:s');
$logaction->user_id = Auth::user()->id;
$logaction->logaction('2FA reset');
return response()->json(['message' => trans('admin/settings/general.two_factor_reset_success')], 200);
} catch (\Exception $e) {

View file

@ -7,6 +7,7 @@ use App\Http\Requests\ImageUploadRequest;
use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\AssetModel;
use App\Models\CustomField;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
@ -486,11 +487,11 @@ class AssetModelsController extends Controller
* @param array $defaultValues
* @return void
*/
private function assignCustomFieldsDefaultValues(AssetModel $model, array $defaultValues)
private function assignCustomFieldsDefaultValues(AssetModel $model, array $defaultValues): bool
{
$data = array();
foreach ($defaultValues as $customFieldId => $defaultValue) {
$customField = \App\Models\CustomField::find($customFieldId);
$customField = CustomField::find($customFieldId);
$data[$customField->db_column] = $defaultValue;
}

View file

@ -102,6 +102,10 @@ class AssetsController extends Controller
{
$this->authorize(Asset::class);
// There are a lot more rules to add here but prevents
// errors around `asset_tags` not being present below.
$this->validate($request, ['asset_tags' => ['required', 'array']]);
// Handle asset tags - there could be one, or potentially many.
// This is only necessary on create, not update, since bulk editing is handled
// differently

View file

@ -14,6 +14,7 @@ use App\View\Label;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Session;
use App\Http\Requests\AssetCheckoutRequest;
use App\Models\CustomField;
@ -93,43 +94,13 @@ class BulkAssetsController extends Controller
$assets = Asset::with('assignedTo', 'location', 'model')->whereIn('assets.id', $asset_ids);
switch ($sort_override) {
case 'model':
$assets->OrderModels($order);
break;
case 'model_number':
$assets->OrderModelNumber($order);
break;
case 'category':
$assets->OrderCategory($order);
break;
case 'manufacturer':
$assets->OrderManufacturer($order);
break;
case 'company':
$assets->OrderCompany($order);
break;
case 'location':
$assets->OrderLocation($order);
case 'rtd_location':
$assets->OrderRtdLocation($order);
break;
case 'status_label':
$assets->OrderStatus($order);
break;
case 'supplier':
$assets->OrderSupplier($order);
break;
case 'assigned_to':
$assets->OrderAssigned($order);
break;
default:
$assets->orderBy($column_sort, $order);
break;
}
$assets = $assets->get();
if ($assets->isEmpty()) {
Log::debug('No assets were found for the provided IDs', ['ids' => $asset_ids]);
return redirect()->back()->with('error', trans('admin/hardware/message.update.assets_do_not_exist_or_are_invalid'));
}
$models = $assets->unique('model_id');
$modelNames = [];
foreach($models as $model) {
@ -176,6 +147,41 @@ class BulkAssetsController extends Controller
}
}
switch ($sort_override) {
case 'model':
$assets->OrderModels($order);
break;
case 'model_number':
$assets->OrderModelNumber($order);
break;
case 'category':
$assets->OrderCategory($order);
break;
case 'manufacturer':
$assets->OrderManufacturer($order);
break;
case 'company':
$assets->OrderCompany($order);
break;
case 'location':
$assets->OrderLocation($order);
case 'rtd_location':
$assets->OrderRtdLocation($order);
break;
case 'status_label':
$assets->OrderStatus($order);
break;
case 'supplier':
$assets->OrderSupplier($order);
break;
case 'assigned_to':
$assets->OrderAssigned($order);
break;
default:
$assets->orderBy($column_sort, $order);
break;
}
return redirect()->back()->with('error', 'No action selected');
}

View file

@ -260,7 +260,7 @@ class CustomFieldsController extends Controller
$field->name = trim(e($request->get("name")));
$field->element = e($request->get("element"));
$field->field_values = e($request->get("field_values"));
$field->field_values = $request->get("field_values");
$field->user_id = Auth::id();
$field->help_text = $request->get("help_text");
$field->show_in_email = $show_in_email;

View file

@ -71,11 +71,13 @@ class LabelsController extends Controller
collect(explode(';', Setting::getSettings()->label2_fields))
->filter()
->each(function ($item) use ($customFieldColumns, $exampleAsset) {
$pair = explode('=', $item);
$pair = explode('=', $item);
if ($customFieldColumns->contains($pair[1])) {
$exampleAsset->{$pair[1]} = "{{$pair[0]}}";
}
if (array_key_exists(1, $pair)) {
if ($customFieldColumns->contains($pair[1])) {
$exampleAsset->{$pair[1]} = "{{$pair[0]}}";
}
}
});
$settings = Setting::getSettings();

View file

@ -320,7 +320,12 @@ class LocationsController extends Controller
$locations_raw_array = $request->input('ids');
if ((is_array($locations_raw_array)) && (count($locations_raw_array) > 0)) {
$locations = Location::whereIn('id', $locations_raw_array)->get();
$locations = Location::whereIn('id', $locations_raw_array)
->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('rtd_assets as rtd_assets_count')
->withCount('children as children_count')
->withCount('users as users_count')->get();
$success_count = 0;
$error_count = 0;
@ -351,7 +356,7 @@ class LocationsController extends Controller
if ($error_count > 0) {
return redirect()
->route('locations.index')
->with('warning', trans('general.bulk.partial_success',
->with('warning', trans('general.bulk.delete.partial',
['success' => $success_count, 'error' => $error_count, 'object_type' => trans('general.locations')]
));
}

View file

@ -700,12 +700,13 @@ class ReportsController extends Controller
}
if (($request->filled('checkin_date_start'))) {
$assets->whereBetween('last_checkin', [
Carbon::parse($request->input('checkin_date_start'))->startOfDay(),
// use today's date if `checkin_date_end` is not provided
Carbon::parse($request->input('checkin_date_end', now()))->endOfDay(),
]);
$checkin_start = \Carbon::parse($request->input('checkin_date_start'))->startOfDay();
// use today's date is `checkin_date_end` is not provided
$checkin_end = \Carbon::parse($request->input('checkin_date_end', now()))->endOfDay();
$assets->whereBetween('assets.last_checkin', [$checkin_start, $checkin_end ]);
}
//last checkin is exporting, but currently is a date and not a datetime in the custom report ONLY.
if (($request->filled('expected_checkin_start')) && ($request->filled('expected_checkin_end'))) {
$assets->whereBetween('assets.expected_checkin', [$request->input('expected_checkin_start'), $request->input('expected_checkin_end')]);
@ -1178,6 +1179,10 @@ class ReportsController extends Controller
}
}
if ($assetItem->assignedTo->email == ''){
return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.no_email'));
}
return redirect()->route('reports/unaccepted_assets')->with('success', trans('admin/reports/general.reminder_sent'));
}

View file

@ -20,6 +20,7 @@ use DB;
use enshrined\svgSanitize\Sanitizer;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\Validation\Rule;
use Image;
use Input;
use Redirect;
@ -500,6 +501,19 @@ class SettingsController extends Controller
*/
public function postSecurity(Request $request)
{
$this->validate($request, [
'pwd_secure_complexity' => 'array',
'pwd_secure_complexity.*' => [
Rule::in([
'disallow_same_pwd_as_user_fields',
'letters',
'numbers',
'symbols',
'case_diff',
])
]
]);
if (is_null($setting = Setting::getSettings())) {
return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
}

View file

@ -31,9 +31,7 @@ class SlackSettingsForm extends Component
'webhook_channel' => 'required_with:webhook_endpoint|starts_with:#|nullable',
'webhook_botname' => 'string|nullable',
];
public $messages = [
'webhook_endpoint.starts_with' => 'your webhook endpoint should begin with http://, https:// or other protocol.',
];
public function mount() {
$this->webhook_text= [

View file

@ -8,6 +8,12 @@ use \App\Helpers\Helper;
class CheckLocale
{
private function warn_legacy_locale($language, $source)
{
if ($language != Helper::mapLegacyLocale($language)) {
\Log::warning("$source $language and should be updated to be ".Helper::mapLegacyLocale($language));
}
}
/**
* Handle the locale for the user, default to settings otherwise.
*
@ -22,24 +28,23 @@ class CheckLocale
// Default app settings from config
$language = config('app.locale');
$this->warn_legacy_locale($language, "APP_LOCALE in .env is set to");
if ($settings = Setting::getSettings()) {
// User's preference
if (($request->user()) && ($request->user()->locale)) {
$language = $request->user()->locale;
$this->warn_legacy_locale($language, "username ".$request->user()->username." (".$request->user()->id.") has a language");
// App setting preference
} elseif ($settings->locale != '') {
$language = $settings->locale;
$this->warn_legacy_locale($language, "App Settings is set to");
}
}
if (config('app.locale') != Helper::mapLegacyLocale($language)) {
\Log::warning('Your current APP_LOCALE in your .env is set to "'.config('app.locale').'" and should be updated to be "'.Helper::mapLegacyLocale($language).'" in '.base_path().'/.env. Translations may display unexpectedly until this is updated.');
}
\App::setLocale(Helper::mapLegacyLocale($language));
return $next($request);
}

View file

@ -34,8 +34,8 @@ class ImageUploadRequest extends Request
{
return [
'image' => 'mimes:png,gif,jpg,jpeg,svg,bmp,svg+xml,webp',
'avatar' => 'mimes:png,gif,jpg,jpeg,svg,bmp,svg+xml,webp',
'image' => 'mimes:png,gif,jpg,jpeg,svg,bmp,svg+xml,webp,avif',
'avatar' => 'mimes:png,gif,jpg,jpeg,svg,bmp,svg+xml,webp,avif',
];
}
@ -103,15 +103,13 @@ class ImageUploadRequest extends Request
\Log::info('File name will be: '.$file_name);
\Log::debug('File extension is: '.$ext);
if ($image->getMimeType() == 'image/webp') {
// If the file is a webp, we need to just move it since webp support
if (($image->getMimeType() == 'image/avif') || ($image->getMimeType() == 'image/webp')) {
// If the file is a webp or avif, we need to just move it since webp support
// needs to be compiled into gd for resizing to be available
\Log::debug('This is a webp, just move it');
Storage::disk('public')->put($path.'/'.$file_name, file_get_contents($image));
} elseif($image->getMimeType() == 'image/svg+xml') {
// If the file is an SVG, we need to clean it and NOT encode it
\Log::debug('This is an SVG');
$sanitizer = new Sanitizer();
$dirtySVG = file_get_contents($image->getRealPath());
$cleanSVG = $sanitizer->sanitize($dirtySVG);
@ -123,9 +121,6 @@ class ImageUploadRequest extends Request
}
} else {
\Log::debug('Not an SVG or webp - resize');
\Log::debug('Trying to upload to: '.$path.'/'.$file_name);
try {
$upload = Image::make($image->getRealPath())->setFileInfoFromPath($image->getRealPath())->resize(null, $w, function ($constraint) {
$constraint->aspectRatio();
@ -147,10 +142,8 @@ class ImageUploadRequest extends Request
// Remove Current image if exists
if (($item->{$form_fieldname}!='') && (Storage::disk('public')->exists($path.'/'.$item->{$db_fieldname}))) {
\Log::debug('A file already exists that we are replacing - we should delete the old one.');
try {
Storage::disk('public')->delete($path.'/'.$item->{$form_fieldname});
\Log::debug('Old file '.$path.'/'.$file_name.' has been deleted.');
} catch (\Exception $e) {
\Log::debug('Could not delete old file. '.$path.'/'.$file_name.' does not exist?');
}

View file

@ -4,6 +4,8 @@ namespace App\Http\Requests;
use App\Models\Asset;
use App\Models\Company;
use Carbon\Carbon;
use Carbon\Exceptions\InvalidFormatException;
use Illuminate\Support\Facades\Gate;
class StoreAssetRequest extends ImageUploadRequest
@ -27,6 +29,8 @@ class StoreAssetRequest extends ImageUploadRequest
? Company::getIdForCurrentUser($this->company_id)
: $this->company_id;
$this->parseLastAuditDate();
$this->merge([
'asset_tag' => $this->asset_tag ?? Asset::autoincrement_asset(),
'company_id' => $idForCurrentUser,
@ -48,4 +52,21 @@ class StoreAssetRequest extends ImageUploadRequest
return $rules;
}
private function parseLastAuditDate(): void
{
if ($this->input('last_audit_date')) {
try {
$lastAuditDate = Carbon::parse($this->input('last_audit_date'));
$this->merge([
'last_audit_date' => $lastAuditDate->startOfDay()->format('Y-m-d H:i:s'),
]);
} catch (InvalidFormatException $e) {
// we don't need to do anything here...
// we'll keep the provided date in an
// invalid format so validation picks it up later
}
}
}
}

View file

@ -27,7 +27,7 @@ class UploadFileRequest extends Request
$max_file_size = \App\Helpers\Helper::file_upload_max_size();
return [
'file.*' => 'required|mimes:png,gif,jpg,svg,jpeg,doc,docx,pdf,txt,zip,rar,xls,xlsx,lic,xml,rtf,json,webp|max:'.$max_file_size,
'file.*' => 'required|mimes:png,gif,jpg,svg,jpeg,doc,docx,pdf,txt,zip,rar,xls,xlsx,lic,xml,rtf,json,webp,avif|max:'.$max_file_size,
];
}

View file

@ -88,6 +88,7 @@ class AssetsTransformer
'purchase_date' => Helper::getFormattedDateObject($asset->purchase_date, 'date'),
'age' => $asset->purchase_date ? $asset->purchase_date->diffForHumans() : '',
'last_checkout' => Helper::getFormattedDateObject($asset->last_checkout, 'datetime'),
'last_checkin' => Helper::getFormattedDateObject($asset->last_checkin, 'datetime'),
'expected_checkin' => Helper::getFormattedDateObject($asset->expected_checkin, 'date'),
'purchase_cost' => Helper::formatCurrencyOutput($asset->purchase_cost),
'checkin_counter' => (int) $asset->checkin_counter,

View file

@ -305,7 +305,7 @@ class Accessory extends SnipeModel
*/
public function requireAcceptance()
{
return $this->category->require_acceptance;
return $this->category->require_acceptance ?? false;
}
/**

View file

@ -96,7 +96,10 @@ class Asset extends Depreciable
'company_id' => 'nullable|integer|exists:companies,id',
'warranty_months' => 'nullable|numeric|digits_between:0,240',
'last_checkout' => 'nullable|date_format:Y-m-d H:i:s',
'last_checkin' => 'nullable|date_format:Y-m-d H:i:s',
'expected_checkin' => 'nullable|date',
'last_audit_date' => 'nullable|date_format:Y-m-d H:i:s',
'next_audit_date' => 'nullable|date|after:last_audit_date',
'location_id' => 'nullable|exists:locations,id',
'rtd_location_id' => 'nullable|exists:locations,id',
'purchase_date' => 'nullable|date|date_format:Y-m-d',
@ -167,6 +170,8 @@ class Asset extends Depreciable
'expected_checkin',
'next_audit_date',
'last_audit_date',
'last_checkin',
'last_checkout',
'asset_eol_date',
];

View file

@ -5,6 +5,8 @@ namespace App\Models;
use Gate;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Rule;
use Watson\Validating\ValidatingTrait;
class CustomFieldset extends Model
@ -92,8 +94,19 @@ class CustomFieldset extends Model
array_push($rule, $field->attributes['format']);
$rules[$field->db_column_name()] = $rule;
//add not_array to rules for all fields
$rules[$field->db_column_name()][] = 'not_array';
// add not_array to rules for all fields but checkboxes
if ($field->element != 'checkbox') {
$rules[$field->db_column_name()][] = 'not_array';
}
if ($field->element == 'checkbox') {
$rules[$field->db_column_name()][] = 'checkboxes';
}
if ($field->element == 'radio') {
$rules[$field->db_column_name()][] = 'radio_buttons';
}
}
return $rules;

View file

@ -160,75 +160,27 @@ class DefaultLabel extends RectangleSheet
$textY += $this->textSize + self::TEXT_MARGIN;
}
// Fields
// Render the selected fields with their labels
$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++;
}
}
if ($fieldsDone < $this->getSupportFields()) {
foreach ($record->get('fields') as $field) {
// Actually write the selected fields and their matching values
static::writeText(
$pdf, (($field['label']) ? $field['label'].' ' : '') . $field['value'],
$textX1, $textY,
'freesans', '', $this->textSize, 'L',
$textW, $this->textSize,
true, 0
);
$textY += $this->textSize + self::TEXT_MARGIN;
$fieldsDone++;
}
}
}
}
?>

View file

@ -0,0 +1,89 @@
<?php
namespace App\Models\Labels\Tapes\Dymo;
class LabelWriter_1933081 extends LabelWriter
{
private const BARCODE_MARGIN = 1.80;
private const TAG_SIZE = 2.80;
private const TITLE_SIZE = 2.80;
private const TITLE_MARGIN = 0.50;
private const LABEL_SIZE = 2.80;
private const LABEL_MARGIN = - 0.35;
private const FIELD_SIZE = 2.80;
private const FIELD_MARGIN = 0.15;
public function getUnit() { return 'mm'; }
public function getWidth() { return 89; }
public function getHeight() { return 25; }
public function getSupportAssetTag() { return true; }
public function getSupport1DBarcode() { return true; }
public function getSupport2DBarcode() { return true; }
public function getSupportFields() { return 5; }
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,
'freesans', '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,
'freesans', 'b', self::TAG_SIZE, 'R',
$usableWidth, self::TAG_SIZE, true, 0
);
}
if ($record->has('title')) {
static::writeText(
$pdf, $record->get('title'),
$currentX, $currentY,
'freesans', 'b', 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']) ? $field['label'].' ' : '') . $field['value'],
$currentX, $currentY,
'freesans', '', self::FIELD_SIZE, 'L',
$usableWidth, self::FIELD_SIZE, true, 0, 0.3
);
$currentY += self::FIELD_SIZE + self::FIELD_MARGIN;
}
if ($record->has('barcode1d')) {
static::write1DBarcode(
$pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type,
$currentX, $barcodeSize + self::BARCODE_MARGIN, $usableWidth - self::TAG_SIZE, self::TAG_SIZE
);
}
}
}

View file

@ -0,0 +1,89 @@
<?php
namespace App\Models\Labels\Tapes\Dymo;
class LabelWriter_2112283 extends LabelWriter
{
private const BARCODE_MARGIN = 1.80;
private const TAG_SIZE = 2.80;
private const TITLE_SIZE = 2.80;
private const TITLE_MARGIN = 0.50;
private const LABEL_SIZE = 2.80;
private const LABEL_MARGIN = - 0.35;
private const FIELD_SIZE = 2.80;
private const FIELD_MARGIN = 0.15;
public function getUnit() { return 'mm'; }
public function getWidth() { return 54; }
public function getHeight() { return 25; }
public function getSupportAssetTag() { return true; }
public function getSupport1DBarcode() { return true; }
public function getSupport2DBarcode() { return true; }
public function getSupportFields() { return 5; }
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,
'freesans', '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,
'freesans', 'b', self::TAG_SIZE, 'R',
$usableWidth, self::TAG_SIZE, true, 0
);
}
if ($record->has('title')) {
static::writeText(
$pdf, $record->get('title'),
$currentX, $currentY,
'freesans', 'b', 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']) ? $field['label'].' ' : '') . $field['value'],
$currentX, $currentY,
'freesans', '', self::FIELD_SIZE, 'L',
$usableWidth, self::FIELD_SIZE, true, 0, 0.3
);
$currentY += self::FIELD_SIZE + self::FIELD_MARGIN;
}
if ($record->has('barcode1d')) {
static::write1DBarcode(
$pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type,
$currentX, $barcodeSize + self::BARCODE_MARGIN, $usableWidth - self::TAG_SIZE, self::TAG_SIZE
);
}
}
}

View file

@ -106,6 +106,7 @@ class Location extends SnipeModel
*/
public function isDeletable()
{
return Gate::allows('delete', $this)
&& ($this->assets_count === 0)
&& ($this->assigned_assets_count === 0)

View file

@ -337,7 +337,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
*/
public function licenses()
{
return $this->belongsToMany(\App\Models\License::class, 'license_seats', 'assigned_to', 'license_id')->withPivot('id');
return $this->belongsToMany(\App\Models\License::class, 'license_seats', 'assigned_to', 'license_id')->withPivot('id', 'created_at', 'updated_at');
}
/**

View file

@ -43,12 +43,12 @@ class CheckinAccessoryNotification extends Notification
public function via()
{
$notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){
if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
if (Setting::getSettings()->webhook_selected == 'microsoft'){
if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}

View file

@ -51,12 +51,12 @@ class CheckinAssetNotification extends Notification
public function via()
{
$notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){
if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
if (Setting::getSettings()->webhook_selected == 'microsoft'){
if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}

View file

@ -48,11 +48,11 @@ class CheckinLicenseSeatNotification extends Notification
{
$notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){
if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
if (Setting::getSettings()->webhook_selected == 'microsoft'){
if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}

View file

@ -42,12 +42,12 @@ class CheckoutAccessoryNotification extends Notification
public function via()
{
$notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){
if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
if (Setting::getSettings()->webhook_selected == 'microsoft'){
if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}

View file

@ -62,12 +62,12 @@ class CheckoutAssetNotification extends Notification
public function via()
{
$notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){
if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
if (Setting::getSettings()->webhook_selected == 'microsoft'){
if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}

View file

@ -49,12 +49,12 @@ class CheckoutConsumableNotification extends Notification
public function via()
{
$notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){
if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
if (Setting::getSettings()->webhook_selected == 'microsoft'){
if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}

View file

@ -41,6 +41,7 @@ class AccessoryPresenter extends Presenter
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'formatter' => 'accessoriesLinkFormatter',
], [

View file

@ -42,6 +42,10 @@ class ActionlogPresenter extends Presenter
// User related icons
if ($this->itemType() == 'user') {
if ($this->actionType()=='2fa reset') {
return 'fa-solid fa-mobile-screen';
}
if ($this->actionType()=='create new') {
return 'fa-solid fa-user-plus';
}
@ -61,6 +65,7 @@ class ActionlogPresenter extends Presenter
if ($this->actionType()=='update') {
return 'fa-solid fa-user-pen';
}
return 'fa-solid fa-user';
}

View file

@ -85,6 +85,7 @@ class AssetMaintenancesPresenter extends Presenter
'field' => 'title',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('admin/asset_maintenances/form.title'),
], [
'field' => 'start_date',

View file

@ -35,6 +35,7 @@ class AssetModelPresenter extends Presenter
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'visible' => true,
'title' => trans('general.name'),
'formatter' => 'modelsLinkFormatter',

View file

@ -55,6 +55,7 @@ class AssetPresenter extends Presenter
'field' => 'asset_tag',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('admin/hardware/table.asset_tag'),
'visible' => true,
'formatter' => 'hardwareLinkFormatter',
@ -252,6 +253,13 @@ class AssetPresenter extends Presenter
'visible' => false,
'title' => trans('admin/hardware/table.checkout_date'),
'formatter' => 'dateDisplayFormatter',
], [
'field' => 'last_checkin',
'searchable' => false,
'sortable' => true,
'visible' => false,
'title' => trans('admin/hardware/table.last_checkin_date'),
'formatter' => 'dateDisplayFormatter',
], [
'field' => 'expected_checkin',
'searchable' => false,
@ -316,7 +324,7 @@ class AssetPresenter extends Presenter
'field' => 'checkincheckout',
'searchable' => false,
'sortable' => false,
'switchable' => true,
'switchable' => false,
'title' => trans('general.checkin').'/'.trans('general.checkout'),
'visible' => true,
'formatter' => 'hardwareInOutFormatter',

View file

@ -25,6 +25,7 @@ class CategoryPresenter extends Presenter
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'categoriesLinkFormatter',

View file

@ -25,7 +25,7 @@ class CompanyPresenter extends Presenter
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'switchable' => false,
'title' => trans('admin/companies/table.name'),
'visible' => true,
'formatter' => 'companiesLinkFormatter',

View file

@ -126,7 +126,7 @@ class ComponentPresenter extends Presenter
'field' => 'checkincheckout',
'searchable' => false,
'sortable' => false,
'switchable' => true,
'switchable' => false,
'title' => trans('general.checkin').'/'.trans('general.checkout'),
'visible' => true,
'formatter' => 'componentsInOutFormatter',

View file

@ -35,6 +35,7 @@ class ConsumablePresenter extends Presenter
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'consumablesLinkFormatter',

View file

@ -25,6 +25,7 @@ class DepreciationPresenter extends Presenter
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'depreciationsLinkFormatter',

View file

@ -34,6 +34,7 @@ class DepreciationReportPresenter extends Presenter
"field" => "name",
"searchable" => true,
"sortable" => true,
'switchable' => false,
"title" => trans('admin/hardware/form.name'),
"visible" => false,
], [

View file

@ -33,6 +33,7 @@ class LicensePresenter extends Presenter
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'formatter' => 'licensesLinkFormatter',
], [
@ -186,7 +187,7 @@ class LicensePresenter extends Presenter
'field' => 'checkincheckout',
'searchable' => false,
'sortable' => false,
'switchable' => true,
'switchable' => false,
'title' => trans('general.checkin').'/'.trans('general.checkout'),
'visible' => true,
'formatter' => 'licensesInOutFormatter',
@ -280,7 +281,7 @@ class LicensePresenter extends Presenter
'field' => 'checkincheckout',
'searchable' => false,
'sortable' => false,
'switchable' => true,
'switchable' => false,
'title' => trans('general.checkin').'/'.trans('general.checkout'),
'visible' => true,
'formatter' => 'licenseSeatInOutFormatter',

View file

@ -31,6 +31,7 @@ class LocationPresenter extends Presenter
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('admin/locations/table.name'),
'visible' => true,
'formatter' => 'locationsLinkFormatter',

View file

@ -27,6 +27,7 @@ class ManufacturerPresenter extends Presenter
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('admin/manufacturers/table.name'),
'visible' => true,
'formatter' => 'manufacturersLinkFormatter',

View file

@ -38,7 +38,7 @@ class UserPresenter extends Presenter
'searchable' => false,
'sortable' => false,
'switchable' => true,
'title' => 'Avatar',
'title' => trans('general.importer.avatar'),
'visible' => false,
'formatter' => 'imageFormatter',
],
@ -175,7 +175,7 @@ class UserPresenter extends Presenter
'field' => 'username',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'switchable' => false,
'title' => trans('admin/users/table.username'),
'visible' => true,
'formatter' => 'usersLinkFormatter',

View file

@ -2,9 +2,12 @@
namespace App\Providers;
use App\Models\CustomField;
use App\Models\Department;
use App\Models\Setting;
use DB;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\Rule;
use Validator;
@ -294,6 +297,39 @@ class ValidationServiceProvider extends ServiceProvider
Validator::extend('not_array', function ($attribute, $value, $parameters, $validator) {
return !is_array($value);
});
// This is only used in Models/CustomFieldset.php - it does automatic validation for checkboxes by making sure
// that the submitted values actually exist in the options.
Validator::extend('checkboxes', function ($attribute, $value, $parameters, $validator){
$field = CustomField::where('db_column', $attribute)->first();
$options = $field->formatFieldValuesAsArray();
if(is_array($value)) {
$invalid = array_diff($value, $options);
if(count($invalid) > 0) {
return false;
}
}
// for legacy, allows users to submit a comma separated string of options
elseif(!is_array($value)) {
$exploded = array_map('trim', explode(',', $value));
$invalid = array_diff($exploded, $options);
if(count($invalid) > 0) {
return false;
}
}
return true;
});
// Validates that a radio button option exists
Validator::extend('radio_buttons', function ($attribute, $value) {
$field = CustomField::where('db_column', $attribute)->first();
$options = $field->formatFieldValuesAsArray();
return in_array($value, $options);
});
}
/**

View file

@ -41,7 +41,7 @@ class Label implements View
$template = LabelModel::find($settings->label2_template);
// If disabled, pass to legacy view
if ((!$settings->label2_enable) && (!$template)) {
if ((!$settings->label2_enable)) {
return view('hardware/labels')
->with('assets', $assets)
->with('settings', $settings)
@ -105,16 +105,15 @@ class Label implements View
}
}
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 ($settings->alt_barcode_enabled) {
if ($template->getSupport1DBarcode()) {
$barcode1DType = $settings->alt_barcode;
if ($barcode1DType != 'none') {
$assetData->put('barcode1d', (object)[
'type' => $barcode1DType,
'content' => $asset->asset_tag,
]);
}
}
}
@ -127,7 +126,7 @@ class Label implements View
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;
default: $barcode2DTarget = route('hardware.show', ['hardware' => $asset->id]); break;
}
$assetData->put('barcode2d', (object)[
'type' => $barcode2DType,

727
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -174,4 +174,17 @@ return [
'bs_table_storage' => env('BS_TABLE_STORAGE', 'cookieStorage'),
/*
|--------------------------------------------------------------------------
| Bootstrap Table Enable Deeplinking
|--------------------------------------------------------------------------
|
| Use deeplinks to directly link to search results, sorting, and pagination
|
| More info: https://github.com/generals-space/bootstrap-table-addrbar/blob/master/readme(EN).md
*/
'bs_table_addrbar' => env('BS_TABLE_DEEPLINK', true),
];

View file

@ -1,10 +1,10 @@
<?php
return array (
'app_version' => 'v6.3.2',
'full_app_version' => 'v6.3.2 - build 12834-g9a5c1b812',
'build_version' => '12834',
'app_version' => 'v6.3.4',
'full_app_version' => 'v6.3.4 - build 13139-g6f9ba6ede',
'build_version' => '13139',
'prerelease_version' => '',
'hash_version' => 'g9a5c1b812',
'full_hash' => 'v6.3.2-160-g9a5c1b812',
'hash_version' => 'g6f9ba6ede',
'full_hash' => 'v6.3.4-234-g6f9ba6ede',
'branch' => 'develop',
);

View file

@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateLegacyLocale extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::table('users', function (Blueprint $table) {
//
$table->string('locale', 10)->nullable()->default('en-US')->change();
});
Schema::table('settings', function (Blueprint $table) {
//
$table->string('locale', 10)->nullable()->default('en-US')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::table('users', function (Blueprint $table) {
//
$table->string('locale', 10)->nullable()->default(config('app.locale'))->change();
});
Schema::table('settings', function (Blueprint $table) {
//
$table->string('locale', 10)->nullable()->default(config('app.locale'))->change();
});
}
}

View file

@ -17,16 +17,23 @@ else
fi
# create data directories
# Note: Keep in sync with expected directories by the app
# https://github.com/snipe/snipe-it/blob/master/app/Console/Commands/RestoreFromBackup.php#L232
for dir in \
'data/private_uploads' \
'data/private_uploads/assets' \
'data/private_uploads/accessories' \
'data/private_uploads/audits' \
'data/private_uploads/components' \
'data/private_uploads/consumables' \
'data/private_uploads/eula-pdfs' \
'data/private_uploads/imports' \
'data/private_uploads/assetmodels' \
'data/private_uploads/users' \
'data/private_uploads/licenses' \
'data/private_uploads/signatures' \
'data/uploads/accessories' \
'data/uploads/assets' \
'data/uploads/avatars' \
'data/uploads/barcodes' \
'data/uploads/categories' \

20
package-lock.json generated
View file

@ -10,13 +10,13 @@
"acorn-import-assertions": "^1.9.0",
"admin-lte": "^2.4.18",
"ajv": "^6.12.6",
"alpinejs": "^3.13.5",
"alpinejs": "3.13.5",
"blueimp-file-upload": "^9.34.0",
"bootstrap": "^3.4.1",
"bootstrap-colorpicker": "^2.5.3",
"bootstrap-datepicker": "^1.10.0",
"bootstrap-less": "^3.3.8",
"bootstrap-table": "1.22.2",
"bootstrap-table": "1.22.3",
"chart.js": "^2.9.4",
"clipboard": "^2.0.11",
"css-loader": "^5.0.0",
@ -26,7 +26,7 @@
"jquery-ui": "^1.13.2",
"jquery-validation": "^1.20.0",
"jquery.iframe-transport": "^1.0.0",
"jspdf-autotable": "^3.8.0",
"jspdf-autotable": "^3.8.2",
"less": "^4.2.0",
"less-loader": "^6.0",
"list.js": "^1.5.0",
@ -36,7 +36,7 @@
"sheetjs": "^2.0.0",
"tableexport.jquery.plugin": "1.28.0",
"tether": "^1.4.0",
"webpack": "^5.90.0"
"webpack": "^5.90.2"
},
"devDependencies": {
"all-contributors-cli": "^6.26.1",
@ -4144,9 +4144,9 @@
"integrity": "sha512-a9MtENtt4r3ttPW5mpIpOFmCaIsm37EGukOgw5cfHlxKvsUSN8AN9JtwKrKuqgEnxs86kUSsMvMn8kqewMorKw=="
},
"node_modules/bootstrap-table": {
"version": "1.22.2",
"resolved": "https://registry.npmjs.org/bootstrap-table/-/bootstrap-table-1.22.2.tgz",
"integrity": "sha512-ZjZGcEXm/N7N/wAykmANWKKV+U+7AxgoNuBwWLrKbvAGT8XXS2f0OCiFmuMwpkqg7pDbF+ff9bEf/lOAlxcF1w==",
"version": "1.22.3",
"resolved": "https://registry.npmjs.org/bootstrap-table/-/bootstrap-table-1.22.3.tgz",
"integrity": "sha512-YWQTXzmZBX6P4y6YW2mHOxqIAYyLKld2WecHuKSyYamimUE4KZ9YUsmAroSoS2Us1bPYXFaM+JCeTt6X0iKW+g==",
"peerDependencies": {
"jquery": "3"
}
@ -8136,9 +8136,9 @@
}
},
"node_modules/jspdf-autotable": {
"version": "3.8.1",
"resolved": "https://registry.npmjs.org/jspdf-autotable/-/jspdf-autotable-3.8.1.tgz",
"integrity": "sha512-UjJqo80Z3/WUzDi4JipTGp0pAvNvR3Gsm38inJ5ZnwsJH0Lw4pEbssRSH6zMWAhR1ZkTrsDpQo5p6rZk987/AQ==",
"version": "3.8.2",
"resolved": "https://registry.npmjs.org/jspdf-autotable/-/jspdf-autotable-3.8.2.tgz",
"integrity": "sha512-zW1ix99/mtR4MbIni7IqvrpfHmuTaICl6iv6wqjRN86Nxtwaw/QtOeDbpXqYSzHIJK9JvgtLM283sc5x+ipkJg==",
"peerDependencies": {
"jspdf": "^2.5.1"
}

View file

@ -30,13 +30,13 @@
"acorn-import-assertions": "^1.9.0",
"admin-lte": "^2.4.18",
"ajv": "^6.12.6",
"alpinejs": "^3.13.5",
"alpinejs": "3.13.5",
"blueimp-file-upload": "^9.34.0",
"bootstrap": "^3.4.1",
"bootstrap-colorpicker": "^2.5.3",
"bootstrap-datepicker": "^1.10.0",
"bootstrap-less": "^3.3.8",
"bootstrap-table": "1.22.2",
"bootstrap-table": "1.22.3",
"chart.js": "^2.9.4",
"clipboard": "^2.0.11",
"css-loader": "^5.0.0",
@ -46,7 +46,7 @@
"jquery-ui": "^1.13.2",
"jquery.iframe-transport": "^1.0.0",
"jquery-validation": "^1.20.0",
"jspdf-autotable": "^3.8.0",
"jspdf-autotable": "^3.8.2",
"less": "^4.2.0",
"less-loader": "^6.0",
"list.js": "^1.5.0",
@ -56,6 +56,6 @@
"sheetjs": "^2.0.0",
"tableexport.jquery.plugin": "1.28.0",
"tether": "^1.4.0",
"webpack": "^5.90.0"
"webpack": "^5.90.2"
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -2,8 +2,8 @@
"/js/build/app.js": "/js/build/app.js?id=a05df3d0d95cb1cb86b26e858563009f",
"/css/dist/skins/skin-red.css": "/css/dist/skins/skin-red.css?id=b9a74ec0cd68f83e7480d5ae39919beb",
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=392cc93cfc0be0349bab9697669dd091",
"/css/build/overrides.css": "/css/build/overrides.css?id=77475bffdab35fb2cd9ebbcd3ebe6dd6",
"/css/build/app.css": "/css/build/app.css?id=7cc9ef2d080c39e4b940df85f68fdf1b",
"/css/build/overrides.css": "/css/build/overrides.css?id=5276161c4e09d905ece0419d16151cbf",
"/css/build/app.css": "/css/build/app.css?id=dde7b2ff6869386f242010a9056c9705",
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=a67bd93bed52e6a29967fe472de66d6c",
"/css/dist/skins/skin-orange.css": "/css/dist/skins/skin-orange.css?id=268041e902b019730c23ee3875838005",
"/css/dist/skins/skin-orange-dark.css": "/css/dist/skins/skin-orange-dark.css?id=d409d9b1a3b69247df8b98941ba06e33",
@ -18,7 +18,7 @@
"/css/dist/skins/skin-green-dark.css": "/css/dist/skins/skin-green-dark.css?id=0ed42b67f9b02a74815e885bfd9e3f66",
"/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/all.css": "/css/dist/all.css?id=a413275c9c27dbbb0aa60a5a5d81ec74",
"/css/dist/all.css": "/css/dist/all.css?id=bd339274b6efdcb815615927d1e734cd",
"/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=69e5d8e4e818f05fd882cceb758d1eba",
@ -29,9 +29,9 @@
"/css/webfonts/fa-solid-900.woff2": "/css/webfonts/fa-solid-900.woff2?id=a0feb384c3c6071947a49708f2b0bc85",
"/css/webfonts/fa-v4compatibility.ttf": "/css/webfonts/fa-v4compatibility.ttf?id=e24ec0b8661f7fa333b29444df39e399",
"/css/webfonts/fa-v4compatibility.woff2": "/css/webfonts/fa-v4compatibility.woff2?id=e11465c0eff0549edd4e8ea6bbcf242f",
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=afa255bf30b2a7c11a97e3165128d183",
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=99c395f0bab5966f32f63f4e55899e64",
"/js/build/vendor.js": "/js/build/vendor.js?id=db2e005808d5a2d2e7f4a82059e5d16f",
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=29340c70d13855fa0165cd4d799c6f5b",
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=857da5daffd13e0553510e5ccd410c79",
"/js/dist/all.js": "/js/dist/all.js?id=5f4bdd1b17a98eb4b59085823cf63972",
"/js/dist/all-defer.js": "/js/dist/all-defer.js?id=19ccc62a8f1ea103dede4808837384d4",
"/css/dist/skins/skin-green.min.css": "/css/dist/skins/skin-green.min.css?id=b48f4d8af0e1ca5621c161e93951109f",

View file

@ -888,3 +888,6 @@ input[type="radio"]:checked::before {
.separator:not(:empty)::after {
margin-left: .25em;
}
.datepicker.dropdown-menu {
z-index: 1030 !important;
}

View file

@ -18,6 +18,7 @@ return [
'success' => 'crwdns745:0crwdne745:0',
'nothing_updated' => 'crwdns1186:0crwdne1186:0',
'no_assets_selected' => 'crwdns6810:0crwdne6810:0',
'assets_do_not_exist_or_are_invalid' => 'crwdns12132:0crwdne12132:0',
],
'restore' => [

View file

@ -261,7 +261,7 @@ return [
'two_factor_enrollment' => 'crwdns1778:0crwdne1778:0',
'two_factor_enabled_text' => 'crwdns1779:0crwdne1779:0',
'two_factor_reset' => 'crwdns1780:0crwdne1780:0',
'two_factor_reset_help' => 'crwdns1781:0crwdne1781:0',
'two_factor_reset_help' => 'crwdns12150:0crwdne12150:0',
'two_factor_reset_success' => 'crwdns1782:0crwdne1782:0',
'two_factor_reset_error' => 'crwdns1783:0crwdne1783:0',
'two_factor_enabled_warning' => 'crwdns1784:0crwdne1784:0',

View file

@ -1,6 +1,7 @@
<?php
return [
'2FA_reset' => 'crwdns12148:0crwdne12148:0',
'accessories' => 'crwdns1200:0crwdne1200:0',
'activated' => 'crwdns1540:0crwdne1540:0',
'accepted_date' => 'crwdns11295:0crwdne11295:0',
@ -201,6 +202,7 @@ return [
'new_password' => 'crwdns6141:0crwdne6141:0',
'next' => 'crwdns1275:0crwdne1275:0',
'next_audit_date' => 'crwdns1919:0crwdne1919:0',
'no_email' => 'crwdns12130:0crwdne12130:0',
'last_audit' => 'crwdns1920:0crwdne1920:0',
'new' => 'crwdns1668:0crwdne1668:0',
'no_depreciation' => 'crwdns1073:0crwdne1073:0',
@ -517,4 +519,13 @@ return [
],
'no_requestable' => 'crwdns12128:0crwdne12128:0',
'countable' => [
'accessories' => 'crwdns12136:0crwdne12136:0',
'assets' => 'crwdns12138:0crwdne12138:0',
'licenses' => 'crwdns12140:0crwdne12140:0',
'license_seats' => 'crwdns12142:0crwdne12142:0',
'consumables' => 'crwdns12144:0crwdne12144:0',
'components' => 'crwdns12146:0crwdne12146:0',
]
];

View file

@ -50,6 +50,7 @@ return [
'sr-CS' => 'crwdns10642:0crwdne10642:0',
'sk-SK'=> 'crwdns12002:0crwdne12002:0',
'sl-SI'=> 'crwdns12004:0crwdne12004:0',
'so-SO'=> 'crwdns12134:0crwdne12134:0',
'es-ES'=> 'crwdns10646:0crwdne10646:0',
'es-CO'=> 'crwdns10648:0crwdne10648:0',
'es-MX'=> 'crwdns10650:0crwdne10650:0',

View file

@ -105,6 +105,8 @@ return [
'gte' => [
'numeric' => 'crwdns6796:0crwdne6796:0'
],
'checkboxes' => 'crwdns12152:0crwdne12152:0',
'radio_buttons' => 'crwdns12154:0crwdne12154:0',
/*
@ -151,4 +153,10 @@ return [
'attributes' => [],
/*
|--------------------------------------------------------------------------
| Generic Validation Messages
|--------------------------------------------------------------------------
*/
'invalid_value_in_field' => 'crwdns12156:0crwdne12156:0',
];

View file

@ -18,6 +18,7 @@ return [
'success' => 'Bate is suksesvol opgedateer.',
'nothing_updated' => 'Geen velde is gekies nie, dus niks is opgedateer nie.',
'no_assets_selected' => 'No assets were selected, so nothing was updated.',
'assets_do_not_exist_or_are_invalid' => 'Selected assets cannot be updated.',
],
'restore' => [

View file

@ -261,7 +261,7 @@ return [
'two_factor_enrollment' => 'Twee-faktorinskrywing',
'two_factor_enabled_text' => 'Aktiveer twee faktore',
'two_factor_reset' => 'Herstel twee-faktor geheim',
'two_factor_reset_help' => 'Dit sal die gebruiker dwing om hul toestel weer met Google Authenticator in te skryf. Dit kan handig wees as hul toestel wat tans ingeskryf is, verlore of gesteel is.',
'two_factor_reset_help' => 'This will force the user to enroll their device with their authenticator app again. This can be useful if their currently enrolled device is lost or stolen. ',
'two_factor_reset_success' => 'Twee faktor toestel suksesvol herstel',
'two_factor_reset_error' => 'Twee faktor toestel herstel het misluk',
'two_factor_enabled_warning' => 'As jy twee faktore aktiveer as dit nie tans geaktiveer is nie, sal dit jou dadelik dwing om te verifieer met \'n Google Auth-ingeskrewe toestel. Jy sal die vermoë hê om jou toestel in te skryf as een nie tans ingeskryf is nie.',

View file

@ -1,6 +1,7 @@
<?php
return [
'2FA_reset' => '2FA reset',
'accessories' => 'bykomstighede',
'activated' => 'geaktiveer',
'accepted_date' => 'Date Accepted',
@ -201,6 +202,7 @@ return [
'new_password' => 'New Password',
'next' => 'volgende',
'next_audit_date' => 'Volgende ouditdatum',
'no_email' => 'No email address associated with this user',
'last_audit' => 'Laaste Oudit',
'new' => 'nuwe!',
'no_depreciation' => 'Geen Waardevermindering',
@ -518,4 +520,13 @@ return [
],
'no_requestable' => 'There are no requestable assets or asset models.',
'countable' => [
'accessories' => ':count Accessory|:count Accessories',
'assets' => ':count Asset|:count Assets',
'licenses' => ':count License|:count Licenses',
'license_seats' => ':count License Seat|:count License Seats',
'consumables' => ':count Consumable|:count Consumables',
'components' => ':count Component|:count Components',
]
];

View file

@ -50,6 +50,7 @@ return [
'sr-CS' => 'Serbian (Latin)',
'sk-SK'=> 'Slovak',
'sl-SI'=> 'Slovenian',
'so-SO'=> 'Somali',
'es-ES'=> 'Spanish',
'es-CO'=> 'Spanish, Colombia',
'es-MX'=> 'Spanish, Mexico',

View file

@ -105,6 +105,8 @@ return [
'gte' => [
'numeric' => 'Value cannot be negative'
],
'checkboxes' => ':attribute contains invalid options.',
'radio_buttons' => ':attribute is invalid.',
/*
@ -151,4 +153,10 @@ return [
'attributes' => [],
/*
|--------------------------------------------------------------------------
| Generic Validation Messages
|--------------------------------------------------------------------------
*/
'invalid_value_in_field' => 'Invalid value included in this field',
];

View file

@ -19,6 +19,7 @@ return [
'success' => 'Asset updated successfully.',
'nothing_updated' => 'No fields were selected, so nothing was updated.',
'no_assets_selected' => 'No assets were selected, so nothing was updated.',
'assets_do_not_exist_or_are_invalid' => 'Selected assets cannot be updated.',
],
'restore' => [

View file

@ -261,7 +261,7 @@ return [
'two_factor_enrollment' => 'Two-Factor Enrollment',
'two_factor_enabled_text' => 'Enable Two Factor',
'two_factor_reset' => 'Reset Two-Factor Secret',
'two_factor_reset_help' => 'This will force the user to enroll their device with Google Authenticator again. This can be useful if their currently enrolled device is lost or stolen. ',
'two_factor_reset_help' => 'This will force the user to enroll their device with their authenticator app again. This can be useful if their currently enrolled device is lost or stolen. ',
'two_factor_reset_success' => 'Two factor device successfully reset',
'two_factor_reset_error' => 'Two factor device reset failed',
'two_factor_enabled_warning' => 'Enabling two-factor if it is not currently enabled will immediately force you to authenticate with a Google Auth enrolled device. You will have the ability to enroll your device if one is not currently enrolled.',

View file

@ -1,6 +1,7 @@
<?php
return [
'2FA_reset' => '2FA reset',
'accessories' => 'መለዋወጫዎች',
'activated' => 'Activated',
'accepted_date' => 'የተቀበለበት ቀን',
@ -201,6 +202,7 @@ return [
'new_password' => 'New Password',
'next' => 'Next',
'next_audit_date' => 'Next Audit Date',
'no_email' => 'No email address associated with this user',
'last_audit' => 'Last Audit',
'new' => 'new!',
'no_depreciation' => 'No Depreciation',
@ -518,4 +520,13 @@ return [
],
'no_requestable' => 'There are no requestable assets or asset models.',
'countable' => [
'accessories' => ':count Accessory|:count Accessories',
'assets' => ':count Asset|:count Assets',
'licenses' => ':count License|:count Licenses',
'license_seats' => ':count License Seat|:count License Seats',
'consumables' => ':count Consumable|:count Consumables',
'components' => ':count Component|:count Components',
]
];

View file

@ -50,6 +50,7 @@ return [
'sr-CS' => 'Serbian (Latin)',
'sk-SK'=> 'Slovak',
'sl-SI'=> 'Slovenian',
'so-SO'=> 'Somali',
'es-ES'=> 'Spanish',
'es-CO'=> 'Spanish, Colombia',
'es-MX'=> 'Spanish, Mexico',

View file

@ -105,6 +105,8 @@ return [
'gte' => [
'numeric' => 'Value cannot be negative'
],
'checkboxes' => ':attribute contains invalid options.',
'radio_buttons' => ':attribute is invalid.',
/*
@ -151,4 +153,10 @@ return [
'attributes' => [],
/*
|--------------------------------------------------------------------------
| Generic Validation Messages
|--------------------------------------------------------------------------
*/
'invalid_value_in_field' => 'Invalid value included in this field',
];

View file

@ -18,6 +18,7 @@ return [
'success' => 'تم تحديث الأصل بنجاح.',
'nothing_updated' => 'لم يتم اختيار أي حقول، لذلك لم يتم تحديث أي شيء.',
'no_assets_selected' => 'لم يتم اختيار أي أصول، لذلك لم يتم تحديث أي شيء.',
'assets_do_not_exist_or_are_invalid' => 'لا يمكن تحديث الأصول المحددة.',
],
'restore' => [

View file

@ -261,7 +261,7 @@ return [
'two_factor_enrollment' => 'اثنان عامل التسجيل',
'two_factor_enabled_text' => 'تمكين عاملين',
'two_factor_reset' => 'إعادة تعيين سر عاملين',
'two_factor_reset_help' => 'سيؤدي هذا إلى إجبار المستخدم على تسجيل أجهزته باستخدام أداة مصادقة غوغل مرة أخرى. ويمكن أن يكون ذلك مفيدا إذا فقدت أو سرقت الجهاز المسجل حاليا.',
'two_factor_reset_help' => 'سيؤدي هذا إلى إجبار المستخدم على تسجيل جهازه مع تطبيق المصادقة الخاص به مرة أخرى. ويمكن أن يكون هذا مفيداً إذا فقدت أو سرقت جهازهم المسجل حالياً. ',
'two_factor_reset_success' => 'جهاز عاملين إعادة تعيين بنجاح',
'two_factor_reset_error' => 'أخفق إعادة تعيين عامل عامل اثنين',
'two_factor_enabled_warning' => 'سيؤدي تمكين عاملين إذا لم يتم تمكينه حاليا إلى إجبارك فورا على المصادقة باستخدام جهاز مسجل في غوغل أوث. سيكون لديك القدرة على تسجيل جهازك إذا كان أحد غير مسجل حاليا.',

View file

@ -1,6 +1,7 @@
<?php
return [
'2FA_reset' => '2FA reset',
'accessories' => 'ملحقات',
'activated' => 'مفعل',
'accepted_date' => 'تم تخزين التاريخ',
@ -201,6 +202,7 @@ return [
'new_password' => 'كلمة المرور الجديدة',
'next' => 'التالى',
'next_audit_date' => 'تاريخ التدقيق التالي',
'no_email' => 'لا يوجد عنوان بريد إلكتروني مرتبط بهذا المستخدم',
'last_audit' => 'آخر مراجعة',
'new' => 'الجديد!',
'no_depreciation' => 'لا يوجد إستهلاك',
@ -518,4 +520,13 @@ return [
],
'no_requestable' => 'لا توجد أصول أو نماذج للأصول التي يمكن طلبها.',
'countable' => [
'accessories' => ':count ملحقات :count ملحقات',
'assets' => ':count أصول :count أصول',
'licenses' => ':count ترخيص :count تراخيص',
'license_seats' => ':count مقاعد الرخصة<unk> :count مقاعد الرخص',
'consumables' => ':count مستهلكة<unk> :count مستهلك',
'components' => ':count مكون<unk> :count مكونات',
]
];

View file

@ -50,6 +50,7 @@ return [
'sr-CS' => 'Serbian (Latin)',
'sk-SK'=> 'السلوفاكية',
'sl-SI'=> 'السلوفينية',
'so-SO'=> 'Somali',
'es-ES'=> 'الإسبانية',
'es-CO'=> 'الإسبانية، كولومبيا',
'es-MX'=> 'الإسبانية، المكسيك',

View file

@ -105,6 +105,8 @@ return [
'gte' => [
'numeric' => 'لا يمكن أن تكون القيمة سالبة'
],
'checkboxes' => ':attribute يحتوي على خيارات غير صالحة.',
'radio_buttons' => ':attribute غير صالح.',
/*
@ -151,4 +153,10 @@ return [
'attributes' => [],
/*
|--------------------------------------------------------------------------
| Generic Validation Messages
|--------------------------------------------------------------------------
*/
'invalid_value_in_field' => 'القيمة غير صالحة المدرجة في هذا الحقل',
];

View file

@ -27,13 +27,12 @@ return [
'undeployable_tooltip' => 'Този актив е забранен за изписване и не може да се изпише в момента.',
'view' => 'Преглед на актив',
'csv_error' => 'Имате грешка във вашият CSV файл:',
'import_text' => '<p>Upload a CSV that contains asset history. The assets and users MUST already exist in the system, or they will be skipped. Matching assets for history import happens against the asset tag. We will try to find a matching user based on the user\'s name you provide, and the criteria you select below. If you do not select any criteria below, it will simply try to match on the username format you configured in the <code>Admin &gt; General Settings</code>.</p><p>Fields included in the CSV must match the headers: <strong>Asset Tag, Name, Checkout Date, Checkin Date</strong>. Any additional fields will be ignored. </p><p>Checkin Date: blank or future checkin dates will checkout items to associated user. Excluding the Checkin Date column will create a checkin date with todays date.</p>
',
'csv_import_match_f-l' => 'Try to match users by <strong>firstname.lastname</strong> (<code>jane.smith</code>) format',
'csv_import_match_initial_last' => 'Try to match users by <strong>first initial last name</strong> (<code>jsmith</code>) format',
'csv_import_match_first' => 'Try to match users by <strong>first name</strong> (<code>jane</code>) format',
'csv_import_match_email' => 'Try to match users by <strong>email</strong> as username',
'csv_import_match_username' => 'Try to match users by <strong>username</strong>',
'import_text' => '<p>Качи CSV файл, който съдържа историята на активите. Активите и потребителите ТРЯБВА да ги има създадени в системата в противен слуай няма да се импортират. При импортиране на историята на активите, съвпадението се прави по техния инвентарен номер. Ще се опитаме да намерим потребителя на база неговото потребителско име и критерия който сте избрали по-долу. Ще се опита да намери съвпадение по формата на потребителско име избран в <code>Admin &gt; General Settings</code>.</p><p>Полетата включени в CSV файла, трябва да съвпадат с <strong>Инвентарен номер, Име, Дата на изписване, Дата на вписване</strong>. Всякакви допълнителни полета ще бъдат игнорирани. </p><p> Празна дата на вписване или дата в бъдещето ще изпише актива към асоцийрания потребител. Ако не се включи колона с дата на вписване, същата ще бъде създадена със текущата дата.</p> ',
'csv_import_match_f-l' => 'Опитай да намериш съвпадение на потребителите по <strong>Име.Фамилия</strong> (<code>Иван.Иванов</code>)',
'csv_import_match_initial_last' => 'Опитай да намериш съвпадение на потребителите по <strong>Първа буква, Фамилия</strong> (<code>ииванов</code>)',
'csv_import_match_first' => 'Опитай да намериш съвпадение на потребителите по <strong>Име</strong> (<code>Иван</code>)',
'csv_import_match_email' => 'Опитай да намериш съвпадение на потребителите по <strong>email</strong>, като потребителско име',
'csv_import_match_username' => 'Опитай да намериш съвпадение на потребителите по <strong>потребителско име</strong>',
'error_messages' => 'Съобщение за грешка:',
'success_messages' => 'Успешно:',
'alert_details' => 'Детайли.',

View file

@ -18,6 +18,7 @@ return [
'success' => 'Активът обновен успешно.',
'nothing_updated' => 'Няма избрани полета, съответно нищо не беше обновено.',
'no_assets_selected' => 'Няма избрани активи, така че нищо не бе обновено.',
'assets_do_not_exist_or_are_invalid' => 'Избраните активи не могат да се обновят.',
],
'restore' => [

View file

@ -46,6 +46,6 @@ return array(
],
],
'below_threshold' => 'There are only :remaining_count seats left for this license with a minimum quantity of :min_amt. You may want to consider purchasing more seats.',
'below_threshold_short' => 'This item is below the minimum required quantity.',
'below_threshold' => 'Има само :remaining_count лиценз(а) останали от този лиценз с минимално количество от :min_amt. Може да желаете да поръчате допълнително.',
'below_threshold_short' => 'Този артикул е под минималното необходимо количество.',
);

View file

@ -261,7 +261,7 @@ return [
'two_factor_enrollment' => 'Двуфакторово записване',
'two_factor_enabled_text' => 'Разреши два фактор',
'two_factor_reset' => 'Нулиране на двуфакторова тайна',
'two_factor_reset_help' => 'Това ще принуди потребителя да запише своето устройство с Google Authenticator отново. Това може да бъде полезно ако записаните понастоящем устройства са изгубени или откраднати.',
'two_factor_reset_help' => 'Това ще принуди потребителя да запише своето устройство с Authenticator отново. Това може да бъде полезно, ако записаните понастоящем устройства са изгубени или откраднати. ',
'two_factor_reset_success' => 'Двуфакторово устройство нулирано успешно',
'two_factor_reset_error' => 'Нулирането на двуфакторово устройство беше неуспешно',
'two_factor_enabled_warning' => 'Разрешаване на два-фактора ако не са разрешени в момента, ще ви принуди незабавно да се удостоверите с устройство записано в Google Auth. Ще имате възможността да запишете устройството си ако нямате такова.',

View file

@ -1,6 +1,7 @@
<?php
return [
'2FA_reset' => '2FA нулиране',
'accessories' => 'Аксесоари',
'activated' => 'Активирано',
'accepted_date' => 'Дата на приемане',
@ -201,6 +202,7 @@ return [
'new_password' => 'Нова парола',
'next' => 'Следващ',
'next_audit_date' => 'Следваща дата на одита',
'no_email' => 'Няма е-майл адрес към този потребител',
'last_audit' => 'Последният одит',
'new' => 'new!',
'no_depreciation' => 'Без амортизация',
@ -516,6 +518,15 @@ return [
'partial' => 'Изтрити :success_count :object_type, но :error_count :object_type не можаха да се изтрият',
],
],
'no_requestable' => 'There are no requestable assets or asset models.',
'no_requestable' => 'Няма активи или модели, които могат да бъдат изисквани.',
'countable' => [
'accessories' => ':count Аксесоар|:count Аксесоари',
'assets' => ':count Актив|:count Активи',
'licenses' => ':count Лиценз|:count Лицензи',
'license_seats' => ':count Лицензно място|:count Лицензни места',
'consumables' => ':count Консуматив|:count Консумативи',
'components' => ':count Компонент|:count Компоненти',
]
];

View file

@ -50,6 +50,7 @@ return [
'sr-CS' => 'Serbian (Latin)',
'sk-SK'=> 'Slovak',
'sl-SI'=> 'Slovenian',
'so-SO'=> 'Somali',
'es-ES'=> 'Spanish',
'es-CO'=> 'Spanish, Colombia',
'es-MX'=> 'Spanish, Mexico',

View file

@ -105,6 +105,8 @@ return [
'gte' => [
'numeric' => 'Стойността не може да бъде отрицателна'
],
'checkboxes' => ':attribute contains invalid options.',
'radio_buttons' => ':attribute is invalid.',
/*
@ -151,4 +153,10 @@ return [
'attributes' => [],
/*
|--------------------------------------------------------------------------
| Generic Validation Messages
|--------------------------------------------------------------------------
*/
'invalid_value_in_field' => 'Invalid value included in this field',
];

View file

@ -19,6 +19,7 @@ return [
'success' => 'Asset updated successfully.',
'nothing_updated' => 'No fields were selected, so nothing was updated.',
'no_assets_selected' => 'No assets were selected, so nothing was updated.',
'assets_do_not_exist_or_are_invalid' => 'Selected assets cannot be updated.',
],
'restore' => [

View file

@ -261,7 +261,7 @@ return [
'two_factor_enrollment' => 'Two-Factor Enrollment',
'two_factor_enabled_text' => 'Enable Two Factor',
'two_factor_reset' => 'Reset Two-Factor Secret',
'two_factor_reset_help' => 'This will force the user to enroll their device with Google Authenticator again. This can be useful if their currently enrolled device is lost or stolen. ',
'two_factor_reset_help' => 'This will force the user to enroll their device with their authenticator app again. This can be useful if their currently enrolled device is lost or stolen. ',
'two_factor_reset_success' => 'Two factor device successfully reset',
'two_factor_reset_error' => 'Two factor device reset failed',
'two_factor_enabled_warning' => 'Enabling two-factor if it is not currently enabled will immediately force you to authenticate with a Google Auth enrolled device. You will have the ability to enroll your device if one is not currently enrolled.',

View file

@ -1,6 +1,7 @@
<?php
return [
'2FA_reset' => '2FA reset',
'accessories' => 'Accessoris',
'activated' => 'Activat',
'accepted_date' => 'Date Accepted',
@ -201,6 +202,7 @@ return [
'new_password' => 'New Password',
'next' => 'Next',
'next_audit_date' => 'Next Audit Date',
'no_email' => 'No email address associated with this user',
'last_audit' => 'Last Audit',
'new' => 'new!',
'no_depreciation' => 'No Depreciation',
@ -518,4 +520,13 @@ return [
],
'no_requestable' => 'There are no requestable assets or asset models.',
'countable' => [
'accessories' => ':count Accessory|:count Accessories',
'assets' => ':count Asset|:count Assets',
'licenses' => ':count License|:count Licenses',
'license_seats' => ':count License Seat|:count License Seats',
'consumables' => ':count Consumable|:count Consumables',
'components' => ':count Component|:count Components',
]
];

View file

@ -50,6 +50,7 @@ return [
'sr-CS' => 'Serbian (Latin)',
'sk-SK'=> 'Slovak',
'sl-SI'=> 'Slovenian',
'so-SO'=> 'Somali',
'es-ES'=> 'Spanish',
'es-CO'=> 'Spanish, Colombia',
'es-MX'=> 'Spanish, Mexico',

View file

@ -105,6 +105,8 @@ return [
'gte' => [
'numeric' => 'Value cannot be negative'
],
'checkboxes' => ':attribute contains invalid options.',
'radio_buttons' => ':attribute is invalid.',
/*
@ -151,4 +153,10 @@ return [
'attributes' => [],
/*
|--------------------------------------------------------------------------
| Generic Validation Messages
|--------------------------------------------------------------------------
*/
'invalid_value_in_field' => 'Invalid value included in this field',
];

View file

@ -19,6 +19,7 @@ return [
'success' => 'Majetek úspěšně aktualizován.',
'nothing_updated' => 'Nebyla zvolena žádná pole, nic se tedy neupravilo.',
'no_assets_selected' => 'Nebyl zvolen žádný majetek, nic se tedy neupravilo.',
'assets_do_not_exist_or_are_invalid' => 'Vybrané položky nelze aktualizovat.',
],
'restore' => [

View file

@ -261,7 +261,7 @@ return [
'two_factor_enrollment' => 'Dvojfaktorový zápis',
'two_factor_enabled_text' => 'Povolit Dvoufaktorové ověření',
'two_factor_reset' => 'Resetovat dvou faktorové tajemství',
'two_factor_reset_help' => 'Tímto bude uživatel přinucen, aby znovu zaregistroval své zařízení pomocí aplikace Google Authenticator. To může být užitečné, pokud ztratil nebo mu bylo odcizeno jeho aktuálně zapsané zařízení. ',
'two_factor_reset_help' => 'To uživatele donutí znovu zapsat své zařízení do svého autentizátoru aplikací. To může být užitečné, pokud je jejich aktuálně zapsané zařízení ztraceno nebo odcizeno. ',
'two_factor_reset_success' => 'Resetování dvoufaktorového zařízení bylo úspěšné',
'two_factor_reset_error' => 'Resetování dvoufaktorového zařízení selhalo',
'two_factor_enabled_warning' => 'Povolení dvoufaktorového zabezpečení, pokud již není v současné době povoleno vás okamžitě donutí k ověření pomocí zařízení zapsaného v Google Auth. Pokud není v současné době žádné registrován. Budete mít možnost zapsat svoje zařízení.',

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