diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index ca3e6400f4..bbdc982599 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -48,7 +48,7 @@ class AssetsController extends Controller * @author [A. Gianotto] [] * @param int $assetId * @since [v4.0] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function index(Request $request, $audit = null) { @@ -443,7 +443,7 @@ class AssetsController extends Controller * @author [A. Gianotto] [] * @param int $assetId * @since [v4.0] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function show(Request $request, $id) { @@ -474,7 +474,7 @@ class AssetsController extends Controller * @author [A. Gianotto] [] * @since [v4.0.16] * @see \App\Http\Transformers\SelectlistTransformer - * + * @return \Illuminate\Http\JsonResponse */ public function selectlist(Request $request) { @@ -530,6 +530,7 @@ class AssetsController extends Controller * @author [A. Gianotto] [] * @param \App\Http\Requests\ImageUploadRequest $request * @since [v4.0] + * @return \Illuminate\Http\JsonResponse */ public function store(ImageUploadRequest $request) { @@ -638,7 +639,7 @@ class AssetsController extends Controller * @author [A. Gianotto] [] * @param \App\Http\Requests\ImageUploadRequest $request * @since [v4.0] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function update(ImageUploadRequest $request, $id) { @@ -719,7 +720,7 @@ class AssetsController extends Controller * @author [A. Gianotto] [] * @param int $assetId * @since [v4.0] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function destroy($id) { @@ -748,7 +749,7 @@ class AssetsController extends Controller * @author [A. Gianotto] [] * @param int $assetId * @since [v5.1.18] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function restore(Request $request, $assetId = null) { @@ -788,7 +789,7 @@ class AssetsController extends Controller * @author [N. Butler] * @param string $tag * @since [v6.0.5] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function checkoutByTag(AssetCheckoutRequest $request, $tag) { @@ -804,7 +805,7 @@ class AssetsController extends Controller * @author [A. Gianotto] [] * @param int $assetId * @since [v4.0] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function checkout(AssetCheckoutRequest $request, $asset_id) { @@ -888,7 +889,7 @@ class AssetsController extends Controller * @author [A. Gianotto] [] * @param int $assetId * @since [v4.0] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function checkin(Request $request, $asset_id) { @@ -944,7 +945,7 @@ class AssetsController extends Controller * * @author [A. Janes] [] * @since [v6.0] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function checkinByTag(Request $request, $tag = null) { @@ -970,7 +971,7 @@ class AssetsController extends Controller * @author [A. Gianotto] [] * @param int $id * @since [v4.0] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function audit(Request $request) @@ -1031,24 +1032,54 @@ class AssetsController extends Controller * * @author [A. Gianotto] [] * @since [v4.0] - * @return JsonResponse + * @return \Illuminate\Http\JsonResponse */ public function requestable(Request $request) { $this->authorize('viewRequestable', Asset::class); + $allowed_columns = [ + 'name', + 'asset_tag', + 'serial', + 'model_number', + 'image', + 'purchase_cost', + 'expected_checkin', + ]; + + $all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load + + foreach ($all_custom_fields as $field) { + $allowed_columns[] = $field->db_column_name(); + } + $assets = Asset::select('assets.*') - ->with('location', 'assetstatus', 'assetlog', 'company', 'defaultLoc','assignedTo', - 'model.category', 'model.manufacturer', 'model.fieldset', 'supplier') + ->with('location', 'assetstatus', 'assetlog', 'company','assignedTo', + 'model.category', 'model.manufacturer', 'model.fieldset', 'supplier', 'requests') ->requestableAssets(); - $offset = request('offset', 0); - $limit = $request->input('limit', 50); - $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; + + + if ($request->filled('search')) { $assets->TextSearch($request->input('search')); } + // Search custom fields by column name + foreach ($all_custom_fields as $field) { + if ($request->filled($field->db_column_name())) { + $assets->where($field->db_column_name(), '=', $request->input($field->db_column_name())); + } + } + + $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; + $sort_override = str_replace('custom_fields.', '', $request->input('sort')); + + // This handles all the pivot sorting (versus the assets.* fields + // in the allowed_columns array) + $column_sort = in_array($sort_override, $allowed_columns) ? $sort_override : 'assets.created_at'; + switch ($request->input('sort')) { case 'model': $assets->OrderModels($order); @@ -1056,17 +1087,19 @@ class AssetsController extends Controller case 'model_number': $assets->OrderModelNumber($order); break; - case 'category': - $assets->OrderCategory($order); - break; - case 'manufacturer': - $assets->OrderManufacturer($order); + case 'location': + $assets->OrderLocation($order); break; default: - $assets->orderBy('assets.created_at', $order); + $assets->orderBy($column_sort, $order); break; } + + // 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'); + $limit = app('api_limit_value'); + $total = $assets->count(); $assets = $assets->skip($offset)->take($limit)->get(); diff --git a/app/Http/Controllers/Api/ProfileController.php b/app/Http/Controllers/Api/ProfileController.php index 4f5e3b1bdf..ef56ed5370 100644 --- a/app/Http/Controllers/Api/ProfileController.php +++ b/app/Http/Controllers/Api/ProfileController.php @@ -11,6 +11,7 @@ use Illuminate\Http\Request; use Laravel\Passport\TokenRepository; use Illuminate\Contracts\Validation\Factory as ValidationFactory; use Illuminate\Support\Facades\Gate; +use App\Models\CustomField; use DB; class ProfileController extends Controller @@ -48,14 +49,23 @@ class ProfileController extends Controller { $checkoutRequests = CheckoutRequest::where('user_id', '=', Auth::user()->id)->get(); - $results = []; + $results = array(); + $show_field = array(); + $showable_fields = array(); $results['total'] = $checkoutRequests->count(); + $all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load + foreach ($all_custom_fields as $field) { + if (($field->field_encrypted=='0') && ($field->show_in_requestable_list=='1')) { + $showable_fields[] = $field->db_column_name(); + } + } + foreach ($checkoutRequests as $checkoutRequest) { // Make sure the asset and request still exist if ($checkoutRequest && $checkoutRequest->itemRequested()) { - $results['rows'][] = [ + $assets = [ 'image' => e($checkoutRequest->itemRequested()->present()->getImageUrl()), 'name' => e($checkoutRequest->itemRequested()->present()->name()), 'type' => e($checkoutRequest->itemType()), @@ -64,7 +74,16 @@ class ProfileController extends Controller 'expected_checkin' => Helper::getFormattedDateObject($checkoutRequest->itemRequested()->expected_checkin, 'datetime'), 'request_date' => Helper::getFormattedDateObject($checkoutRequest->created_at, 'datetime'), ]; + + foreach ($showable_fields as $showable_field_name) { + $show_field['custom_fields.'.$showable_field_name] = $checkoutRequest->itemRequested()->{$showable_field_name}; + } + + // Merge the plain asset data and the custom fields data + $results['rows'][] = array_merge($assets, $show_field); } + + } return $results; diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php index 932176286f..bd234cb9a6 100644 --- a/app/Http/Controllers/Assets/BulkAssetsController.php +++ b/app/Http/Controllers/Assets/BulkAssetsController.php @@ -195,9 +195,15 @@ class BulkAssetsController extends Controller } if ($request->filled('rtd_location_id')) { - $this->update_array['rtd_location_id'] = $request->input('rtd_location_id'); + if (($request->filled('update_real_loc')) && (($request->input('update_real_loc')) == '0')) { + $this->update_array['rtd_location_id'] = $request->input('rtd_location_id'); + } if (($request->filled('update_real_loc')) && (($request->input('update_real_loc')) == '1')) { $this->update_array['location_id'] = $request->input('rtd_location_id'); + $this->update_array['rtd_location_id'] = $request->input('rtd_location_id'); + } + if (($request->filled('update_real_loc')) && (($request->input('update_real_loc')) == '2')) { + $this->update_array['location_id'] = $request->input('rtd_location_id'); } } diff --git a/app/Http/Controllers/CustomFieldsController.php b/app/Http/Controllers/CustomFieldsController.php index c9579ae7ef..ffe5eceec2 100644 --- a/app/Http/Controllers/CustomFieldsController.php +++ b/app/Http/Controllers/CustomFieldsController.php @@ -110,6 +110,7 @@ class CustomFieldsController extends Controller "display_in_user_view" => $display_in_user_view, "auto_add_to_fieldsets" => $request->get("auto_add_to_fieldsets", 0), "show_in_listview" => $request->get("show_in_listview", 0), + "show_in_requestable_list" => $request->get("show_in_requestable_list", 0), "user_id" => Auth::id() ]); @@ -267,6 +268,7 @@ class CustomFieldsController extends Controller $field->display_in_user_view = $display_in_user_view; $field->auto_add_to_fieldsets = $request->get("auto_add_to_fieldsets", 0); $field->show_in_listview = $request->get("show_in_listview", 0); + $field->show_in_requestable_list = $request->get("show_in_requestable_list", 0); if ($request->get('format') == 'CUSTOM REGEX') { $field->format = e($request->get('custom_format')); diff --git a/app/Http/Requests/CustomAssetReportRequest.php b/app/Http/Requests/CustomAssetReportRequest.php index a34d1b8ae8..2a8fbe7fab 100644 --- a/app/Http/Requests/CustomAssetReportRequest.php +++ b/app/Http/Requests/CustomAssetReportRequest.php @@ -22,9 +22,6 @@ class CustomAssetReportRequest extends Request public function rules() { return [ - 'purchase_date' => 'date|date_format:Y-m-d|nullable', - 'checkout_date' => 'date|date_format:Y-m-d|nullable', - 'checkin_date' => 'date|date_format:Y-m-d|nullable', 'purchase_start' => 'date|date_format:Y-m-d|nullable', 'purchase_end' => 'date|date_format:Y-m-d|nullable', 'created_start' => 'date|date_format:Y-m-d|nullable', diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index 70b0cfe8d2..d38eac2419 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -8,7 +8,7 @@ use App\Models\Setting; use Illuminate\Support\Facades\Gate; use Illuminate\Database\Eloquent\Collection; use Carbon\Carbon; - +use Auth; class AssetsTransformer { @@ -232,6 +232,29 @@ class AssetsTransformer 'assigned_to_self' => ($asset->assigned_to == \Auth::user()->id), ]; + if (($asset->model) && ($asset->model->fieldset) && ($asset->model->fieldset->fields->count() > 0)) { + $fields_array = []; + + foreach ($asset->model->fieldset->fields as $field) { + + // Only display this if it's allowed via the custom field setting + if (($field->field_encrypted=='0') && ($field->show_in_requestable_list=='1')) { + + $value = $asset->{$field->db_column}; + if (($field->format == 'DATE') && (!is_null($value)) && ($value != '')) { + $value = Helper::getFormattedDateObject($value, 'date', false); + } + + $fields_array[$field->db_column] = e($value); + } + + $array['custom_fields'] = $fields_array; + } + } else { + $array['custom_fields'] = new \stdClass; // HACK to force generation of empty object instead of empty list + } + + $permissions_array['available_actions'] = [ 'cancel' => ($asset->isRequestedBy(\Auth::user())) ? true : false, 'request' => ($asset->isRequestedBy(\Auth::user())) ? false : true, diff --git a/app/Importer/AssetImporter.php b/app/Importer/AssetImporter.php index 76eae0739a..5014efac12 100644 --- a/app/Importer/AssetImporter.php +++ b/app/Importer/AssetImporter.php @@ -5,6 +5,9 @@ namespace App\Importer; use App\Models\Asset; use App\Models\AssetModel; use App\Models\Statuslabel; +use App\Models\User; +use App\Events\CheckoutableCheckedIn; +use Illuminate\Support\Facades\Auth; use Carbon\Carbon; class AssetImporter extends ItemImporter @@ -142,6 +145,12 @@ class AssetImporter extends ItemImporter //-- user_id is a property of the abstract class Importer, which this class inherits from and it's setted by //-- the class that needs to use it (command importer or GUI importer inside the project). if (isset($target)) { + if (!is_null($asset->assigned_to)){ + if ($asset->assigned_to != $target->id){ + event(new CheckoutableCheckedIn($asset, User::find($asset->assigned_to), Auth::user(), $asset->notes, date('Y-m-d H:i:s'))); + } + } + $asset->fresh()->checkOut($target, $this->user_id, date('Y-m-d H:i:s'), null, $asset->notes, $asset->name); } diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 7bce0df242..63df483729 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -787,7 +787,6 @@ class Asset extends Depreciable } - /** * Get the next autoincremented asset tag * @@ -950,6 +949,7 @@ class Asset extends Depreciable ->orWhere('assets_users.first_name', 'LIKE', '%'.$term.'%') ->orWhere('assets_users.last_name', 'LIKE', '%'.$term.'%') ->orWhere('assets_users.username', 'LIKE', '%'.$term.'%') + ->orWhere('assets_users.employee_num', 'LIKE', '%'.$term.'%') ->orWhereMultipleColumns([ 'assets_users.first_name', 'assets_users.last_name', diff --git a/app/Models/CustomField.php b/app/Models/CustomField.php index c98dbe637c..c1826a94d8 100644 --- a/app/Models/CustomField.php +++ b/app/Models/CustomField.php @@ -53,6 +53,12 @@ class CustomField extends Model 'field_encrypted' => 'nullable|boolean', 'auto_add_to_fieldsets' => 'boolean', 'show_in_listview' => 'boolean', + 'show_in_requestable_list' => 'boolean', + 'show_in_email' => 'boolean', + ]; + + protected $casts = [ + 'show_in_requestable_list' => 'boolean', ]; /** @@ -72,7 +78,8 @@ class CustomField extends Model 'display_in_user_view', 'auto_add_to_fieldsets', 'show_in_listview', - + 'show_in_email', + 'show_in_requestable_list', ]; /** @@ -243,8 +250,6 @@ class CustomField extends Model /** * Gets the DB column name. * - * @todo figure out if this is still needed? I don't know WTF it's for. - * * @author [A. Gianotto] [] * @since [v3.0] * @return string diff --git a/app/Notifications/CheckinAccessoryNotification.php b/app/Notifications/CheckinAccessoryNotification.php index 53be68f58f..7735f7dc11 100644 --- a/app/Notifications/CheckinAccessoryNotification.php +++ b/app/Notifications/CheckinAccessoryNotification.php @@ -26,7 +26,6 @@ class CheckinAccessoryNotification extends Notification $this->admin = $checkedInby; $this->note = $note; $this->settings = Setting::getSettings(); - \Log::debug('Constructor for notification fired'); } /** diff --git a/database/migrations/2023_10_25_064324_add_show_in_requestable_to_custom_fields.php b/database/migrations/2023_10_25_064324_add_show_in_requestable_to_custom_fields.php new file mode 100644 index 0000000000..710a56e819 --- /dev/null +++ b/database/migrations/2023_10_25_064324_add_show_in_requestable_to_custom_fields.php @@ -0,0 +1,34 @@ +boolean('show_in_requestable_list')->after('show_in_email')->nullable()->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('custom_fields', function (Blueprint $table) { + if (Schema::hasColumn('custom_fields', 'show_in_requestable_list')) { + $table->dropColumn('show_in_requestable_list'); + } + }); + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 101c15d3b5..15272ce5c5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: ports: - "8000:80" volumes: - - ./logs:/var/www/html/storage/logs + - ./storage/logs:/var/www/html/storage/logs depends_on: - mariadb - redis diff --git a/resources/lang/en/admin/accessories/message.php b/resources/lang/en/admin/accessories/message.php index 542f71f03c..c688d5e03d 100644 --- a/resources/lang/en/admin/accessories/message.php +++ b/resources/lang/en/admin/accessories/message.php @@ -3,6 +3,7 @@ return array( 'does_not_exist' => 'The accessory [:id] does not exist.', + 'not_found' => 'That accessory was not found.', 'assoc_users' => 'This accessory currently has :count items checked out to users. Please check in the accessories and and try again. ', 'create' => array( diff --git a/resources/lang/en/admin/custom_fields/general.php b/resources/lang/en/admin/custom_fields/general.php index cb4ab3730a..e3c21d1f0c 100644 --- a/resources/lang/en/admin/custom_fields/general.php +++ b/resources/lang/en/admin/custom_fields/general.php @@ -34,7 +34,8 @@ return [ 'create_field' => 'New Custom Field', 'create_field_title' => 'Create a new custom field', 'value_encrypted' => 'The value of this field is encrypted in the database. Only admin users will be able to view the decrypted value', - 'show_in_email' => 'Include the value of this field in checkout emails sent to the user? Encrypted fields cannot be included in emails.', + 'show_in_email' => 'Include the value of this field in checkout emails sent to the user? Encrypted fields cannot be included in emails', + 'show_in_email_short' => 'Include in emails.', 'help_text' => 'Help Text', 'help_text_description' => 'This is optional text that will appear below the form elements while editing an asset to provide context on the field.', 'about_custom_fields_title' => 'About Custom Fields', @@ -51,7 +52,10 @@ 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' => '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', + 'show_in_requestable_list_short' => 'Show in requestable assets list', + 'show_in_requestable_list' => 'Show value in requestable assets list. Encrypted fields will not be shown', + 'encrypted_options' => 'This field is encrypted, so some display options will not be available.', ]; diff --git a/resources/lang/en/admin/hardware/form.php b/resources/lang/en/admin/hardware/form.php index ef877c8377..ee3fa20fb0 100644 --- a/resources/lang/en/admin/hardware/form.php +++ b/resources/lang/en/admin/hardware/form.php @@ -49,6 +49,7 @@ return [ 'asset_location' => 'Update Asset Location', 'asset_location_update_default_current' => 'Update default location AND actual location', 'asset_location_update_default' => 'Update only default location', + 'asset_location_update_actual' => 'Update only actual location', 'asset_not_deployable' => 'That asset status is not deployable. This asset cannot be checked out.', 'asset_deployable' => 'That status is deployable. This asset can be checked out.', 'processing_spinner' => 'Processing... (This might take a bit of time on large files)', diff --git a/resources/lang/en/help.php b/resources/lang/en/help.php index a3a2ddd762..a59e0056be 100644 --- a/resources/lang/en/help.php +++ b/resources/lang/en/help.php @@ -30,5 +30,6 @@ return [ 'consumables' => 'Consumables are anything purchased that will be used up over time. For example, printer ink or copier paper.', 'depreciations' => 'You can set up asset depreciations to depreciate assets based on straight-line depreciation.', - + + 'empty_file' => 'The importer detects that this file is empty.' ]; diff --git a/resources/views/account/requestable-assets.blade.php b/resources/views/account/requestable-assets.blade.php index adec7a100a..8e3c08fd57 100644 --- a/resources/views/account/requestable-assets.blade.php +++ b/resources/views/account/requestable-assets.blade.php @@ -65,6 +65,12 @@ {{ trans('admin/hardware/table.location') }} {{ trans('admin/hardware/table.status') }} {{ trans('admin/hardware/form.expected_checkin') }} + + @foreach(\App\Models\CustomField::get() as $field) + @if (($field->field_encrypted=='0') && ($field->show_in_requestable_list=='1')) + {{ $field->name }} + @endif + @endforeach {{ trans('table.actions') }} diff --git a/resources/views/account/requested.blade.php b/resources/views/account/requested.blade.php index e3d80edf69..e2e1db2e51 100644 --- a/resources/views/account/requested.blade.php +++ b/resources/views/account/requested.blade.php @@ -32,13 +32,19 @@ }'> - {{ trans('general.image') }} - {{ trans('general.item_name') }} - {{ trans('general.type') }} - {{ trans('general.qty') }} - {{ trans('admin/hardware/table.location') }} - {{ trans('admin/hardware/form.expected_checkin') }} - {{ trans('general.requested_date') }} + {{ trans('general.image') }} + {{ trans('general.item_name') }} + {{ trans('general.type') }} + {{ trans('general.qty') }} + {{ trans('admin/hardware/table.location') }} + {{ trans('admin/hardware/form.expected_checkin') }} + {{ trans('general.requested_date') }} + + @foreach(\App\Models\CustomField::get() as $field) + @if (($field->field_encrypted=='0') && ($field->show_in_requestable_list=='1')) + {{ $field->name }} + @endif + @endforeach diff --git a/resources/views/custom_fields/fields/edit.blade.php b/resources/views/custom_fields/fields/edit.blade.php index ac945d8597..504b556faa 100644 --- a/resources/views/custom_fields/fields/edit.blade.php +++ b/resources/views/custom_fields/fields/edit.blade.php @@ -88,7 +88,7 @@ } @endphp
- {{ Form::select("format",Helper::predefined_formats(), ($field_format == '') ? $field->format : $field_format, array('class'=>'format select2 form-control', 'aria-label'=>'format')) }} + {{ Form::select("format",Helper::predefined_formats(), ($field_format == '') ? $field->format : $field_format, array('class'=>'format select2 form-control', 'aria-label'=>'format', 'style' => 'width:100%;')) }} {!! $errors->first('format', '') !!}
@@ -118,10 +118,40 @@ + +
+ + + @if (($field->id) && ($field->field_encrypted=='1')) +
+
+ + {{ trans('general.notification_warning') }}: + {{ trans('admin/custom_fields/general.encrypted_options') }} +
+ +
+ @endif + + @if (!$field->id) + +
+ +
+ + + @endif + -
+
- @if (!$field->id) - -
- -
- - @endif + @if ((!$field->id) || ($field->field_encrypted=='0')) + + +
+ +
-
+
+ +
+ +
+ @endif + -
+
- -
- -
+
@@ -287,11 +316,13 @@ $("#show_in_email").hide(); $("#display_in_user_view").hide(); $("#is_unique").hide(); + $("#show_in_requestable_list").hide(); } else { $("#encrypt_warning").hide(); $("#show_in_email").show(); $("#display_in_user_view").show(); $("#is_unique").show(); + $("#show_in_requestable_list").show(); } }); diff --git a/resources/views/custom_fields/index.blade.php b/resources/views/custom_fields/index.blade.php index 141d715344..7b0c4965d8 100644 --- a/resources/views/custom_fields/index.blade.php +++ b/resources/views/custom_fields/index.blade.php @@ -145,12 +145,13 @@ - + - - - {{ trans('admin/custom_fields/general.field_element_short') }} + + + + {{ trans('admin/custom_fields/general.field_element_short') }} {{ trans('admin/custom_fields/general.fieldsets') }} {{ trans('button.actions') }} @@ -161,7 +162,7 @@ {{ $field->name }} {{ $field->help_text }} - {!! ($field->is_unique=='1') ? '' : '' !!} + {!! ($field->is_unique=='1') ? '' : '' !!} {{ $field->convertUnicodeDbSlug() }} @if ($field->convertUnicodeDbSlug()!=$field->db_column) @@ -170,10 +171,11 @@ @endif {{ $field->format }} - {!! ($field->field_encrypted=='1' ? '' : '') !!} - {!! ($field->show_in_listview=='1' ? '' : '') !!} - {!! ($field->display_in_user_view=='1' ? '' : '') !!} - {!! ($field->show_in_email=='1') ? '' : '' !!} + {!! ($field->field_encrypted=='1' ? '' : '') !!} + {!! ($field->show_in_listview=='1' ? '' : '') !!} + {!! ($field->display_in_user_view=='1' ? '' : '') !!} + {!! ($field->show_in_email=='1') ? '' : '' !!} + {!! ($field->show_in_requestable_list=='1') ? '' : '' !!} {{ $field->element }} @foreach($field->fieldset as $fieldset) diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 296a940b3f..2744946871 100755 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -274,63 +274,136 @@
- -
-
-

{{ trans('general.asset') }} {{ trans('general.locations') }}

-
- -
-
- -
-
-
-
- - - - - - - - - - - -
{{ trans('general.name') }} - - {{ trans('general.asset_count') }} - - - {{ trans('general.assigned') }} - - - {{ trans('general.people') }} - -
-
-
- -
+ @if ($snipeSettings->full_multiple_companies_support=='1') + +
+
+

{{ trans('general.companies') }}

+
+ +
+
+ +
+
+
+
+ - - + + + + + + + + + + + +
{{ trans('general.name') }} + + {{ trans('general.people') }} + + + {{ trans('general.asset_count') }} + + + {{ trans('general.accessories_count') }} + + + {{ trans('general.consumables_count') }} + + + {{ trans('general.components_count') }} + + + {{ trans('general.licenses_count') }} +
+
+
+ +
+ +
+
+ + @else + +
+
+

{{ trans('general.locations') }}

+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + + +
{{ trans('general.name') }} + + {{ trans('general.asset_count') }} + + + {{ trans('general.assigned') }} + + + {{ trans('general.people') }} + +
+
+
+ +
+ +
+
+ + @endif +
diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.php index 667126ec99..e26b957057 100755 --- a/resources/views/hardware/bulk.blade.php +++ b/resources/views/hardware/bulk.blade.php @@ -92,9 +92,13 @@ {{ Form::radio('update_real_loc', '1', old('update_real_loc'), ['checked'=> 'checked', 'aria-label'=>'update_real_loc']) }} {{ trans('admin/hardware/form.asset_location_update_default_current') }} +
diff --git a/resources/views/livewire/importer.blade.php b/resources/views/livewire/importer.blade.php index 297dcc7b87..0134cfe7f2 100644 --- a/resources/views/livewire/importer.blade.php +++ b/resources/views/livewire/importer.blade.php @@ -235,9 +235,16 @@ ]) }}
+ @if ($activeFile->first_row)

{{ str_limit($activeFile->first_row[$index], 50, '...') }}

+ @else + @php + $statusText = trans('help.empty_file'); + $statusType = 'info'; + @endphp + @endif
@endforeach @else diff --git a/resources/views/notifications.blade.php b/resources/views/notifications.blade.php index 1811b3cdd7..eca773e219 100755 --- a/resources/views/notifications.blade.php +++ b/resources/views/notifications.blade.php @@ -41,7 +41,7 @@
- {{ trans('general.asset_information') }} + {{ trans('general.asset_information') }}:
    @isset ($asset->model->name)
  • {{ trans('general.model_name') }} {{ $asset->model->name }}
  • @@ -67,7 +67,7 @@
    - {{ trans('general.consumable_information') }} + {{ trans('general.consumable_information') }}:
    • {{ trans('general.consumable_name') }} {{ $consumable->name }}
@@ -81,7 +81,7 @@
- {{ trans('general.accessory_information') }} + {{ trans('general.accessory_information') }}:
  • {{ trans('general.accessory_name') }} {{ $accessory->name }}
@@ -94,7 +94,7 @@
- {{ trans('general.error') }} + {{ trans('general.error') }}: {{ $message }}
@@ -107,7 +107,7 @@
- {{ trans('general.notification_error') }} + {{ trans('general.notification_error') }}: {{ $message }}