diff --git a/.chipperci.yml b/.chipperci.yml index c45d4ddedc..0c1ad8ba15 100644 --- a/.chipperci.yml +++ b/.chipperci.yml @@ -15,15 +15,15 @@ on: - develop pull_request: - branches: - - master - - develop + branches: .* pipeline: - name: Setup cmd: | cp -v .env.example .env - +# This is simply to allow passing the guard in TestCase@setUp() +# https://chipperci.com/docs/builds/env + touch .env.testing composer install --no-interaction --prefer-dist --optimize-autoloader - name: Generate Key diff --git a/.env.example b/.env.example index fbf5c4cfff..a9563e6321 100644 --- a/.env.example +++ b/.env.example @@ -85,6 +85,7 @@ COOKIE_NAME=snipeit_session COOKIE_DOMAIN=null SECURE_COOKIES=false API_TOKEN_EXPIRATION_YEARS=15 +BS_TABLE_STORAGE=cookieStorage # -------------------------------------------- # OPTIONAL: SECURITY HEADER SETTINGS diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index dd6fea8b66..f77f5f8c48 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -212,9 +212,12 @@ class LdapSync extends Command $item['manager'] = $results[$i][$ldap_result_manager][0] ?? ''; $item['location'] = $results[$i][$ldap_result_location][0] ?? ''; - $location = Location::firstOrCreate([ - 'name' => $item['location'], - ]); + // ONLY if you are using the "ldap_location" option *AND* you have an actual result + if ($ldap_result_location && $item['location']) { + $location = Location::firstOrCreate([ + 'name' => $item['location'], + ]); + } $department = Department::firstOrCreate([ 'name' => $item['department'], ]); diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index c85564fc3c..f0f2f5e13e 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -33,6 +33,16 @@ class Helper } } + public static function parseEscapedMarkedownInline($str = null) + { + $Parsedown = new \Parsedown(); + $Parsedown->setSafeMode(true); + + if ($str) { + return $Parsedown->line($str); + } + } + /** * The importer has formatted number strings since v3, * so the value might be a string, or an integer. @@ -543,8 +553,8 @@ class Helper 'license' => trans('general.license'), ]; - if($selection != null){ - return $category_types[$selection]; + if ($selection != null){ + return $category_types[strtolower($selection)]; } else return $category_types; diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 222f528e4a..e8f37d8574 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -545,7 +545,8 @@ class AssetsController extends Controller $asset->model_id = $request->get('model_id'); $asset->order_number = $request->get('order_number'); $asset->notes = $request->get('notes'); - $asset->asset_tag = $request->get('asset_tag', Asset::autoincrement_asset()); + $asset->asset_tag = $request->get('asset_tag', Asset::autoincrement_asset()); //yup, problem :/ + // NO IT IS NOT!!! This is never firing; we SHOW the asset_tag you're going to get, so it *will* be filled in! $asset->user_id = Auth::id(); $asset->archived = '0'; $asset->physical = '1'; diff --git a/app/Http/Controllers/Api/CompaniesController.php b/app/Http/Controllers/Api/CompaniesController.php index d6c8f6e76e..72297440dd 100644 --- a/app/Http/Controllers/Api/CompaniesController.php +++ b/app/Http/Controllers/Api/CompaniesController.php @@ -27,6 +27,8 @@ class CompaniesController extends Controller $allowed_columns = [ 'id', 'name', + 'phone', + 'fax', 'created_at', 'updated_at', 'users_count', diff --git a/app/Http/Controllers/Api/DepartmentsController.php b/app/Http/Controllers/Api/DepartmentsController.php index cab3991baa..ef988af597 100644 --- a/app/Http/Controllers/Api/DepartmentsController.php +++ b/app/Http/Controllers/Api/DepartmentsController.php @@ -30,6 +30,8 @@ class DepartmentsController extends Controller $departments = Company::scopeCompanyables(Department::select( 'departments.id', 'departments.name', + 'departments.phone', + 'departments.fax', 'departments.location_id', 'departments.company_id', 'departments.manager_id', diff --git a/app/Http/Controllers/Api/LocationsController.php b/app/Http/Controllers/Api/LocationsController.php index 4b1feee117..87bc266217 100644 --- a/app/Http/Controllers/Api/LocationsController.php +++ b/app/Http/Controllers/Api/LocationsController.php @@ -37,6 +37,8 @@ class LocationsController extends Controller 'locations.city', 'locations.state', 'locations.zip', + 'locations.phone', + 'locations.fax', 'locations.country', 'locations.parent_id', 'locations.manager_id', @@ -251,8 +253,12 @@ class LocationsController extends Controller */ public function selectlist(Request $request) { - - $this->authorize('view.selectlists'); + // If a user is in the process of editing their profile, as determined by the referrer, + // then we check that they have permission to edit their own location. + // Otherwise, we do our normal check that they can view select lists. + $request->headers->get('referer') === route('profile') + ? $this->authorize('self.edit_location') + : $this->authorize('view.selectlists'); $locations = Location::select([ 'locations.id', diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index dc444ec9e9..7b22f3af4b 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -78,12 +78,6 @@ class UsersController extends Controller $users = Company::scopeCompanyables($users); - if (($request->filled('deleted')) && ($request->input('deleted') == 'true')) { - $users = $users->onlyTrashed(); - } elseif (($request->filled('all')) && ($request->input('all') == 'true')) { - $users = $users->withTrashed(); - } - if ($request->filled('activated')) { $users = $users->where('users.activated', '=', $request->input('activated')); } @@ -272,6 +266,12 @@ class UsersController extends Controller break; } + if (($request->filled('deleted')) && ($request->input('deleted') == 'true')) { + $users = $users->onlyTrashed(); + } elseif (($request->filled('all')) && ($request->input('all') == 'true')) { + $users = $users->withTrashed(); + } + $total = $users->count(); $users = $users->skip($offset)->take($limit)->get(); diff --git a/app/Http/Controllers/Assets/AssetCheckinController.php b/app/Http/Controllers/Assets/AssetCheckinController.php index 657b02171b..fd5cee30ea 100644 --- a/app/Http/Controllers/Assets/AssetCheckinController.php +++ b/app/Http/Controllers/Assets/AssetCheckinController.php @@ -94,14 +94,18 @@ class AssetCheckinController extends Controller \Log::debug('Manually override the location IDs'); \Log::debug('Original Location ID: '.$asset->location_id); $asset->location_id = ''; - \Log::debug('New RTD Location ID: '.$asset->location_id); + \Log::debug('New Location ID: '.$asset->location_id); } $asset->location_id = $asset->rtd_location_id; if ($request->filled('location_id')) { \Log::debug('NEW Location ID: '.$request->get('location_id')); - $asset->location_id = e($request->get('location_id')); + $asset->location_id = $request->get('location_id'); + + if ($request->get('update_default_location') == 0){ + $asset->rtd_location_id = $request->get('location_id'); + } } $checkin_at = date('Y-m-d H:i:s'); diff --git a/app/Http/Controllers/CompaniesController.php b/app/Http/Controllers/CompaniesController.php index 396ec5ef68..b02e3194f9 100644 --- a/app/Http/Controllers/CompaniesController.php +++ b/app/Http/Controllers/CompaniesController.php @@ -60,6 +60,8 @@ final class CompaniesController extends Controller $company = new Company; $company->name = $request->input('name'); + $company->phone = $request->input('phone'); + $company->fax = $request->input('fax'); $company = $request->handleImages($company); @@ -111,6 +113,8 @@ final class CompaniesController extends Controller $this->authorize('update', $company); $company->name = $request->input('name'); + $company->phone = $request->input('phone'); + $company->fax = $request->input('fax'); $company = $request->handleImages($company); diff --git a/app/Http/Controllers/CustomFieldsController.php b/app/Http/Controllers/CustomFieldsController.php index bbc3790d63..c9579ae7ef 100644 --- a/app/Http/Controllers/CustomFieldsController.php +++ b/app/Http/Controllers/CustomFieldsController.php @@ -109,6 +109,7 @@ class CustomFieldsController extends Controller "is_unique" => $request->get("is_unique", 0), "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), "user_id" => Auth::id() ]); @@ -265,6 +266,7 @@ class CustomFieldsController extends Controller $field->is_unique = $request->get("is_unique", 0); $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); if ($request->get('format') == 'CUSTOM REGEX') { $field->format = e($request->get('custom_format')); diff --git a/app/Http/Controllers/DepartmentsController.php b/app/Http/Controllers/DepartmentsController.php index 4b2b97ce7f..2d456c0a4a 100644 --- a/app/Http/Controllers/DepartmentsController.php +++ b/app/Http/Controllers/DepartmentsController.php @@ -170,6 +170,8 @@ class DepartmentsController extends Controller $department->manager_id = ($request->filled('manager_id') ? $request->input('manager_id') : null); $department->location_id = ($request->filled('location_id') ? $request->input('location_id') : null); $department->company_id = ($request->filled('company_id') ? $request->input('company_id') : null); + $department->phone = $request->input('phone'); + $department->fax = $request->input('fax'); $department = $request->handleImages($department); diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.php index 39b73a9797..08dc38b3ac 100755 --- a/app/Http/Controllers/LocationsController.php +++ b/app/Http/Controllers/LocationsController.php @@ -79,6 +79,8 @@ class LocationsController extends Controller $location->ldap_ou = $request->input('ldap_ou'); $location->manager_id = $request->input('manager_id'); $location->user_id = Auth::id(); + $location->phone = request('phone'); + $location->fax = request('fax'); $location = $request->handleImages($location); @@ -139,6 +141,8 @@ class LocationsController extends Controller $location->state = $request->input('state'); $location->country = $request->input('country'); $location->zip = $request->input('zip'); + $location->phone = request('phone'); + $location->fax = request('fax'); $location->ldap_ou = $request->input('ldap_ou'); $location->manager_id = $request->input('manager_id'); diff --git a/app/Http/Livewire/Importer.php b/app/Http/Livewire/Importer.php index 6b5770cb6b..ff471adc4b 100644 --- a/app/Http/Livewire/Importer.php +++ b/app/Http/Livewire/Importer.php @@ -284,6 +284,8 @@ class Importer extends Component 'maintained' => trans('admin/licenses/form.maintained'), 'checkout_class' => trans('general.importer.checkout_type'), 'serial' => trans('general.license_serial'), + 'email' => trans('general.importer.checked_out_to_email'), + 'username' => trans('general.importer.checked_out_to_username'), ]; $this->users_fields = [ @@ -313,7 +315,7 @@ class Importer extends Component 'gravatar' => trans('general.importer.gravatar'), 'start_date' => trans('general.start_date'), 'end_date' => trans('general.end_date'), - 'employee_number' => trans('general.employee_number'), + 'employee_num' => trans('general.employee_number'), ]; $this->locations_fields = [ diff --git a/app/Http/Transformers/AccessoriesTransformer.php b/app/Http/Transformers/AccessoriesTransformer.php index 709b337c93..7b79973a9a 100644 --- a/app/Http/Transformers/AccessoriesTransformer.php +++ b/app/Http/Transformers/AccessoriesTransformer.php @@ -32,7 +32,7 @@ class AccessoriesTransformer 'model_number' => ($accessory->model_number) ? e($accessory->model_number) : null, 'category' => ($accessory->category) ? ['id' => $accessory->category->id, 'name'=> e($accessory->category->name)] : null, 'location' => ($accessory->location) ? ['id' => $accessory->location->id, 'name'=> e($accessory->location->name)] : null, - 'notes' => ($accessory->notes) ? Helper::parseEscapedMarkedown($accessory->notes) : null, + 'notes' => ($accessory->notes) ? Helper::parseEscapedMarkedownInline($accessory->notes) : null, 'qty' => ($accessory->qty) ? (int) $accessory->qty : null, 'purchase_date' => ($accessory->purchase_date) ? Helper::getFormattedDateObject($accessory->purchase_date, 'date') : null, 'purchase_cost' => Helper::formatCurrencyOutput($accessory->purchase_cost), diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index ab756a4dd3..7b7a7fc011 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -110,7 +110,7 @@ class ActionlogsTransformer 'type' => e($actionlog->targetType()), ] : null, - 'note' => ($actionlog->note) ? Helper::parseEscapedMarkedown($actionlog->note): null, + 'note' => ($actionlog->note) ? Helper::parseEscapedMarkedownInline($actionlog->note): null, 'signature_file' => ($actionlog->accept_signature) ? route('log.signature.view', ['filename' => $actionlog->accept_signature ]) : null, 'log_meta' => ((isset($clean_meta)) && (is_array($clean_meta))) ? $clean_meta: null, 'action_date' => ($actionlog->action_date) ? Helper::getFormattedDateObject($actionlog->action_date, 'datetime'): Helper::getFormattedDateObject($actionlog->created_at, 'datetime'), diff --git a/app/Http/Transformers/AssetMaintenancesTransformer.php b/app/Http/Transformers/AssetMaintenancesTransformer.php index 433c06a49d..fa92640823 100644 --- a/app/Http/Transformers/AssetMaintenancesTransformer.php +++ b/app/Http/Transformers/AssetMaintenancesTransformer.php @@ -49,7 +49,7 @@ class AssetMaintenancesTransformer 'id' => (int) $assetmaintenance->asset->defaultLoc->id, 'name'=> e($assetmaintenance->asset->defaultLoc->name), ] : null, - 'notes' => ($assetmaintenance->notes) ? Helper::parseEscapedMarkedown($assetmaintenance->notes) : null, + 'notes' => ($assetmaintenance->notes) ? Helper::parseEscapedMarkedownInline($assetmaintenance->notes) : null, 'supplier' => ($assetmaintenance->supplier) ? ['id' => $assetmaintenance->supplier->id, 'name'=> e($assetmaintenance->supplier->name)] : null, 'cost' => Helper::formatCurrencyOutput($assetmaintenance->cost), 'asset_maintenance_type' => e($assetmaintenance->asset_maintenance_type), diff --git a/app/Http/Transformers/AssetModelsTransformer.php b/app/Http/Transformers/AssetModelsTransformer.php index a2da6c8b42..f3a658c872 100644 --- a/app/Http/Transformers/AssetModelsTransformer.php +++ b/app/Http/Transformers/AssetModelsTransformer.php @@ -63,7 +63,7 @@ class AssetModelsTransformer 'default_fieldset_values' => $default_field_values, 'eol' => ($assetmodel->eol > 0) ? $assetmodel->eol.' months' : 'None', 'requestable' => ($assetmodel->requestable == '1') ? true : false, - 'notes' => Helper::parseEscapedMarkedown($assetmodel->notes), + 'notes' => Helper::parseEscapedMarkedownInline($assetmodel->notes), 'created_at' => Helper::getFormattedDateObject($assetmodel->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($assetmodel->updated_at, 'datetime'), 'deleted_at' => Helper::getFormattedDateObject($assetmodel->deleted_at, 'datetime'), diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index 0ad93b43ef..1633ec6167 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -58,7 +58,7 @@ class AssetsTransformer 'id' => (int) $asset->supplier->id, 'name'=> e($asset->supplier->name), ] : null, - 'notes' => ($asset->notes) ? Helper::parseEscapedMarkedown($asset->notes) : null, + 'notes' => ($asset->notes) ? Helper::parseEscapedMarkedownInline($asset->notes) : null, 'order_number' => ($asset->order_number) ? e($asset->order_number) : null, 'company' => ($asset->company) ? [ 'id' => (int) $asset->company->id, diff --git a/app/Http/Transformers/CompaniesTransformer.php b/app/Http/Transformers/CompaniesTransformer.php index 4f1de75dec..4726630c4e 100644 --- a/app/Http/Transformers/CompaniesTransformer.php +++ b/app/Http/Transformers/CompaniesTransformer.php @@ -26,6 +26,8 @@ class CompaniesTransformer $array = [ 'id' => (int) $company->id, 'name' => e($company->name), + 'phone' => ($company->phone!='') ? e($company->phone): null, + 'fax' => ($company->fax!='') ? e($company->fax): null, 'image' => ($company->image) ? Storage::disk('public')->url('companies/'.e($company->image)) : null, 'created_at' => Helper::getFormattedDateObject($company->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($company->updated_at, 'datetime'), diff --git a/app/Http/Transformers/ComponentsTransformer.php b/app/Http/Transformers/ComponentsTransformer.php index e758a95e3c..d18870bdc3 100644 --- a/app/Http/Transformers/ComponentsTransformer.php +++ b/app/Http/Transformers/ComponentsTransformer.php @@ -46,7 +46,7 @@ class ComponentsTransformer 'id' => (int) $component->company->id, 'name' => e($component->company->name), ] : null, - 'notes' => ($component->notes) ? Helper::parseEscapedMarkedown($component->notes) : null, + 'notes' => ($component->notes) ? Helper::parseEscapedMarkedownInline($component->notes) : null, 'created_at' => Helper::getFormattedDateObject($component->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($component->updated_at, 'datetime'), 'user_can_checkout' => ($component->numRemaining() > 0) ? 1 : 0, diff --git a/app/Http/Transformers/ConsumablesTransformer.php b/app/Http/Transformers/ConsumablesTransformer.php index 27e70fcf0b..f23ebc0382 100644 --- a/app/Http/Transformers/ConsumablesTransformer.php +++ b/app/Http/Transformers/ConsumablesTransformer.php @@ -39,7 +39,7 @@ class ConsumablesTransformer 'purchase_cost' => Helper::formatCurrencyOutput($consumable->purchase_cost), 'purchase_date' => Helper::getFormattedDateObject($consumable->purchase_date, 'date'), 'qty' => (int) $consumable->qty, - 'notes' => ($consumable->notes) ? Helper::parseEscapedMarkedown($consumable->notes) : null, + 'notes' => ($consumable->notes) ? Helper::parseEscapedMarkedownInline($consumable->notes) : null, 'created_at' => Helper::getFormattedDateObject($consumable->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($consumable->updated_at, 'datetime'), ]; diff --git a/app/Http/Transformers/CustomFieldsTransformer.php b/app/Http/Transformers/CustomFieldsTransformer.php index db467be0bd..d6401a3e5e 100644 --- a/app/Http/Transformers/CustomFieldsTransformer.php +++ b/app/Http/Transformers/CustomFieldsTransformer.php @@ -49,6 +49,7 @@ class CustomFieldsTransformer 'required' => (($field->pivot) && ($field->pivot->required=='1')) ? true : false, 'display_in_user_view' => ($field->display_in_user_view =='1') ? true : false, 'auto_add_to_fieldsets' => ($field->auto_add_to_fieldsets == '1') ? true : false, + 'show_in_listview' => ($field->show_in_listview == '1') ? true : false, 'created_at' => Helper::getFormattedDateObject($field->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($field->updated_at, 'datetime'), ]; diff --git a/app/Http/Transformers/DepartmentsTransformer.php b/app/Http/Transformers/DepartmentsTransformer.php index 7a0d7647d1..546cedf04f 100644 --- a/app/Http/Transformers/DepartmentsTransformer.php +++ b/app/Http/Transformers/DepartmentsTransformer.php @@ -26,6 +26,8 @@ class DepartmentsTransformer $array = [ 'id' => (int) $department->id, 'name' => e($department->name), + 'phone' => ($department->phone!='') ? e($department->phone): null, + 'fax' => ($department->fax!='') ? e($department->fax): null, 'image' => ($department->image) ? Storage::disk('public')->url(app('departments_upload_url').e($department->image)) : null, 'company' => ($department->company) ? [ 'id' => (int) $department->company->id, diff --git a/app/Http/Transformers/LicensesTransformer.php b/app/Http/Transformers/LicensesTransformer.php index b5b0d841f5..f68ad738d8 100644 --- a/app/Http/Transformers/LicensesTransformer.php +++ b/app/Http/Transformers/LicensesTransformer.php @@ -34,7 +34,7 @@ class LicensesTransformer 'depreciation' => ($license->depreciation) ? ['id' => (int) $license->depreciation->id,'name'=> e($license->depreciation->name)] : null, 'purchase_cost' => Helper::formatCurrencyOutput($license->purchase_cost), 'purchase_cost_numeric' => $license->purchase_cost, - 'notes' => Helper::parseEscapedMarkedown($license->notes), + 'notes' => Helper::parseEscapedMarkedownInline($license->notes), 'expiration_date' => Helper::getFormattedDateObject($license->expiration_date, 'date'), 'seats' => (int) $license->seats, 'free_seats_count' => (int) $license->free_seats_count, diff --git a/app/Http/Transformers/LocationsTransformer.php b/app/Http/Transformers/LocationsTransformer.php index 22eade5d6e..635a90cbc7 100644 --- a/app/Http/Transformers/LocationsTransformer.php +++ b/app/Http/Transformers/LocationsTransformer.php @@ -43,6 +43,8 @@ class LocationsTransformer 'state' => ($location->state) ? e($location->state) : null, 'country' => ($location->country) ? e($location->country) : null, 'zip' => ($location->zip) ? e($location->zip) : null, + 'phone' => ($location->phone!='') ? e($location->phone): null, + 'fax' => ($location->fax!='') ? e($location->fax): null, 'assigned_assets_count' => (int) $location->assigned_assets_count, 'assets_count' => (int) $location->assets_count, 'rtd_assets_count' => (int) $location->rtd_assets_count, diff --git a/app/Http/Transformers/SuppliersTransformer.php b/app/Http/Transformers/SuppliersTransformer.php index e81198763d..1fdc93c193 100644 --- a/app/Http/Transformers/SuppliersTransformer.php +++ b/app/Http/Transformers/SuppliersTransformer.php @@ -43,7 +43,7 @@ class SuppliersTransformer 'licenses_count' => (int) $supplier->licenses_count, 'consumables_count' => (int) $supplier->consumables_count, 'components_count' => (int) $supplier->components_count, - 'notes' => ($supplier->notes) ? Helper::parseEscapedMarkedown($supplier->notes) : null, + 'notes' => ($supplier->notes) ? Helper::parseEscapedMarkedownInline($supplier->notes) : null, 'created_at' => Helper::getFormattedDateObject($supplier->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($supplier->updated_at, 'datetime'), diff --git a/app/Http/Transformers/UsersTransformer.php b/app/Http/Transformers/UsersTransformer.php index 5a45a00124..76c0288073 100644 --- a/app/Http/Transformers/UsersTransformer.php +++ b/app/Http/Transformers/UsersTransformer.php @@ -53,7 +53,7 @@ class UsersTransformer 'id' => (int) $user->userloc->id, 'name'=> e($user->userloc->name), ] : null, - 'notes'=> Helper::parseEscapedMarkedown($user->notes), + 'notes'=> Helper::parseEscapedMarkedownInline($user->notes), 'permissions' => $user->decodePermissions(), 'activated' => ($user->activated == '1') ? true : false, 'autoassign_licenses' => ($user->autoassign_licenses == '1') ? true : false, diff --git a/app/Models/Asset.php b/app/Models/Asset.php index e3d17d5e35..861269d5f2 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -785,24 +785,17 @@ class Asset extends Depreciable * @since [v4.0] * @return string | false */ - public static function autoincrement_asset() + public static function autoincrement_asset(int $additional_increment = 0) { $settings = \App\Models\Setting::getSettings(); if ($settings->auto_increment_assets == '1') { - $temp_asset_tag = \DB::table('assets') - ->where('physical', '=', '1') - ->max('asset_tag'); - - $asset_tag_digits = preg_replace('/\D/', '', $temp_asset_tag); - $asset_tag = preg_replace('/^0*/', '', $asset_tag_digits); - if ($settings->zerofill_count > 0) { - return $settings->auto_increment_prefix.self::zerofill($settings->next_auto_tag_base, $settings->zerofill_count); + return $settings->auto_increment_prefix.self::zerofill($settings->next_auto_tag_base + $additional_increment, $settings->zerofill_count); } - return $settings->auto_increment_prefix.$settings->next_auto_tag_base; + return $settings->auto_increment_prefix.($settings->next_auto_tag_base + $additional_increment); } else { return false; } diff --git a/app/Models/CheckoutRequest.php b/app/Models/CheckoutRequest.php index 26abdd301e..b717a332aa 100644 --- a/app/Models/CheckoutRequest.php +++ b/app/Models/CheckoutRequest.php @@ -18,7 +18,7 @@ class CheckoutRequest extends Model public function requestingUser() { - return $this->user()->first(); + return $this->user()->withTrashed()->first(); } public function requestedItem() diff --git a/app/Models/Company.php b/app/Models/Company.php index 413011b9a7..10b44077ae 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -45,7 +45,7 @@ final class Company extends SnipeModel * * @var array */ - protected $searchableAttributes = ['name', 'created_at', 'updated_at']; + protected $searchableAttributes = ['name', 'phone', 'fax', 'created_at', 'updated_at']; /** * The relations and their attributes that should be included when searching the model. @@ -59,7 +59,11 @@ final class Company extends SnipeModel * * @var array */ - protected $fillable = ['name']; + protected $fillable = [ + 'name', + 'phone', + 'fax', + ]; private static function isFullMultipleCompanySupportEnabled() { diff --git a/app/Models/CustomField.php b/app/Models/CustomField.php index 94adbe7cf0..e7fddd1aad 100644 --- a/app/Models/CustomField.php +++ b/app/Models/CustomField.php @@ -53,6 +53,7 @@ class CustomField extends Model 'element' => 'required|in:text,listbox,textarea,checkbox,radio', 'field_encrypted' => 'nullable|boolean', 'auto_add_to_fieldsets' => 'boolean', + 'show_in_listview' => 'boolean', ]; /** @@ -71,6 +72,7 @@ class CustomField extends Model 'is_unique', 'display_in_user_view', 'auto_add_to_fieldsets', + 'show_in_listview', ]; diff --git a/app/Models/Department.php b/app/Models/Department.php index 74e2b23df9..90fde79df4 100644 --- a/app/Models/Department.php +++ b/app/Models/Department.php @@ -43,6 +43,8 @@ class Department extends SnipeModel protected $fillable = [ 'user_id', 'name', + 'phone', + 'fax', 'location_id', 'company_id', 'manager_id', @@ -56,7 +58,7 @@ class Department extends SnipeModel * * @var array */ - protected $searchableAttributes = ['name', 'notes']; + protected $searchableAttributes = ['name', 'notes', 'phone', 'fax']; /** * The relations and their attributes that should be included when searching the model. diff --git a/app/Models/Location.php b/app/Models/Location.php index 2f4e78dcc7..145d6cef9a 100755 --- a/app/Models/Location.php +++ b/app/Models/Location.php @@ -66,6 +66,8 @@ class Location extends SnipeModel 'state', 'country', 'zip', + 'phone', + 'fax', 'ldap_ou', 'currency', 'manager_id', @@ -80,7 +82,7 @@ class Location extends SnipeModel * * @var array */ - protected $searchableAttributes = ['name', 'address', 'city', 'state', 'zip', 'created_at', 'ldap_ou']; + protected $searchableAttributes = ['name', 'address', 'city', 'state', 'zip', 'created_at', 'ldap_ou', 'phone', 'fax']; /** * The relations and their attributes that should be included when searching the model. diff --git a/app/Observers/AssetObserver.php b/app/Observers/AssetObserver.php index a399e1d2a6..84595f04b3 100644 --- a/app/Observers/AssetObserver.php +++ b/app/Observers/AssetObserver.php @@ -71,12 +71,33 @@ class AssetObserver public function created(Asset $asset) { if ($settings = Setting::getSettings()) { - $settings->increment('next_auto_tag_base'); - $settings->save(); + $tag = $asset->asset_tag; + $prefix = $settings->auto_increment_prefix; + $number = substr($tag, strlen($prefix)); + // IF - auto_increment_assets is on, AND (the prefix matches the start of the tag OR there is no prefix) + // AND the rest of the string after the prefix is all digits, THEN... + if ($settings->auto_increment_assets && (strpos($tag, $prefix) === 0 || $prefix=='') && preg_match('/\d+/',$number) === 1) { + // new way of auto-trueing-up auto_increment ID's + $next_asset_tag = intval($number, 10) + 1; + // we had to use 'intval' because the $number could be '01234' and + // might get interpreted in Octal instead of decimal + + // only modify the 'next' one if it's *bigger* than the stored base + // + if($next_asset_tag > $settings->next_auto_tag_base) { + $settings->next_auto_tag_base = $next_asset_tag; + $settings->save(); + } + + } else { + // legacy method + $settings->increment('next_auto_tag_base'); + $settings->save(); + } } $logAction = new Actionlog(); - $logAction->item_type = Asset::class; + $logAction->item_type = Asset::class; // can we instead say $logAction->item = $asset ? $logAction->item_id = $asset->id; $logAction->created_at = date('Y-m-d H:i:s'); $logAction->user_id = Auth::id(); diff --git a/app/Presenters/AssetModelPresenter.php b/app/Presenters/AssetModelPresenter.php index 8e3d109045..8da192ebb2 100644 --- a/app/Presenters/AssetModelPresenter.php +++ b/app/Presenters/AssetModelPresenter.php @@ -123,6 +123,7 @@ class AssetModelPresenter extends Presenter 'switchable' => true, 'title' => trans('general.notes'), 'visible' => false, + 'formatter' => 'notesFormatter', ], [ 'field' => 'created_at', diff --git a/app/Presenters/AssetPresenter.php b/app/Presenters/AssetPresenter.php index ce476d082c..7c989ee22d 100644 --- a/app/Presenters/AssetPresenter.php +++ b/app/Presenters/AssetPresenter.php @@ -292,7 +292,7 @@ class AssetPresenter extends Presenter 'formatter'=> 'customFieldsFormatter', 'escape' => true, 'class' => ($field->field_encrypted == '1') ? 'css-padlock' : '', - 'visible' => true, + 'visible' => ($field->show_in_listview == '1') ? true : false, ]; } diff --git a/app/Presenters/CompanyPresenter.php b/app/Presenters/CompanyPresenter.php index a6aaebf7e4..767def2e36 100644 --- a/app/Presenters/CompanyPresenter.php +++ b/app/Presenters/CompanyPresenter.php @@ -29,6 +29,22 @@ class CompanyPresenter extends Presenter 'title' => trans('admin/companies/table.name'), 'visible' => true, 'formatter' => 'companiesLinkFormatter', + ], [ + 'field' => 'phone', + 'searchable' => true, + 'sortable' => true, + 'switchable' => true, + 'title' => trans('admin/users/table.phone'), + 'visible' => false, + 'formatter' => 'phoneFormatter', + ], [ + 'field' => 'fax', + 'searchable' => true, + 'sortable' => true, + 'switchable' => true, + 'title' => trans('admin/suppliers/table.fax'), + 'visible' => false, + 'formatter' => 'phoneFormatter', ], [ 'field' => 'image', 'searchable' => false, diff --git a/app/Presenters/LocationPresenter.php b/app/Presenters/LocationPresenter.php index d4281839a1..bf4ee27bba 100644 --- a/app/Presenters/LocationPresenter.php +++ b/app/Presenters/LocationPresenter.php @@ -141,6 +141,24 @@ class LocationPresenter extends Presenter 'title' => trans('admin/locations/table.country'), 'visible' => false, ], + [ + 'field' => 'phone', + 'searchable' => true, + 'sortable' => true, + 'switchable' => true, + 'title' => trans('admin/users/table.phone'), + 'visible' => false, + 'formatter' => 'phoneFormatter', + ], + [ + 'field' => 'fax', + 'searchable' => true, + 'sortable' => true, + 'switchable' => true, + 'title' => trans('admin/suppliers/table.fax'), + 'visible' => false, + 'formatter' => 'phoneFormatter', + ], [ 'field' => 'ldap_ou', 'searchable' => true, diff --git a/composer.json b/composer.json index 341075b5cb..117473e6e7 100644 --- a/composer.json +++ b/composer.json @@ -79,7 +79,7 @@ "squizlabs/php_codesniffer": "^3.5", "symfony/css-selector": "^4.4", "symfony/dom-crawler": "^4.4", - "vimeo/psalm": "^5.6" + "vimeo/psalm": "^5.13" }, "extra": { "laravel": { diff --git a/composer.lock b/composer.lock index a051c590eb..ad92d09ffe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e176ce10814f5dda2b4122265d3433b8", + "content-hash": "5d8f11efafbf126fd89eca49f4ce7e29", "packages": [ { "name": "alek13/slack", @@ -247,16 +247,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.275.5", + "version": "3.275.9", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "d46961b82e857f77059c0c78160719ecb26f6cc6" + "reference": "1ef08ba5109591751257ad1eaa52c2e2fbd53cf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d46961b82e857f77059c0c78160719ecb26f6cc6", - "reference": "d46961b82e857f77059c0c78160719ecb26f6cc6", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/1ef08ba5109591751257ad1eaa52c2e2fbd53cf1", + "reference": "1ef08ba5109591751257ad1eaa52c2e2fbd53cf1", "shasum": "" }, "require": { @@ -336,9 +336,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.275.5" + "source": "https://github.com/aws/aws-sdk-php/tree/3.275.9" }, - "time": "2023-07-07T18:20:11+00:00" + "time": "2023-07-18T18:20:13+00:00" }, { "name": "bacon/bacon-qr-code", @@ -1747,16 +1747,16 @@ }, { "name": "filp/whoops", - "version": "2.15.2", + "version": "2.15.3", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73" + "reference": "c83e88a30524f9360b11f585f71e6b17313b7187" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/aac9304c5ed61bf7b1b7a6064bf9806ab842ce73", - "reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73", + "url": "https://api.github.com/repos/filp/whoops/zipball/c83e88a30524f9360b11f585f71e6b17313b7187", + "reference": "c83e88a30524f9360b11f585f71e6b17313b7187", "shasum": "" }, "require": { @@ -1806,7 +1806,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.15.2" + "source": "https://github.com/filp/whoops/tree/2.15.3" }, "funding": [ { @@ -1814,20 +1814,20 @@ "type": "github" } ], - "time": "2023-04-12T12:00:00+00:00" + "time": "2023-07-13T12:00:00+00:00" }, { "name": "firebase/php-jwt", - "version": "v6.8.0", + "version": "v6.8.1", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "48b0210c51718d682e53210c24d25c5a10a2299b" + "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/48b0210c51718d682e53210c24d25c5a10a2299b", - "reference": "48b0210c51718d682e53210c24d25c5a10a2299b", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5dbc8959427416b8ee09a100d7a8588c00fb2e26", + "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26", "shasum": "" }, "require": { @@ -1875,9 +1875,9 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.8.0" + "source": "https://github.com/firebase/php-jwt/tree/v6.8.1" }, - "time": "2023-06-20T16:45:35+00:00" + "time": "2023-07-14T18:33:00+00:00" }, { "name": "fruitcake/laravel-cors", @@ -3069,16 +3069,16 @@ }, { "name": "laravel/socialite", - "version": "v5.6.3", + "version": "v5.8.0", "source": { "type": "git", "url": "https://github.com/laravel/socialite.git", - "reference": "00ea7f8630673ea49304fc8a9fca5a64eb838c7e" + "reference": "50148edf24b6cd3e428aa9bc06a5d915b24376bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/socialite/zipball/00ea7f8630673ea49304fc8a9fca5a64eb838c7e", - "reference": "00ea7f8630673ea49304fc8a9fca5a64eb838c7e", + "url": "https://api.github.com/repos/laravel/socialite/zipball/50148edf24b6cd3e428aa9bc06a5d915b24376bb", + "reference": "50148edf24b6cd3e428aa9bc06a5d915b24376bb", "shasum": "" }, "require": { @@ -3135,7 +3135,7 @@ "issues": "https://github.com/laravel/socialite/issues", "source": "https://github.com/laravel/socialite" }, - "time": "2023-06-06T13:42:43+00:00" + "time": "2023-07-14T14:22:58+00:00" }, { "name": "laravel/tinker", @@ -6793,16 +6793,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.18", + "version": "v0.11.19", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "4f00ee9e236fa6a48f4560d1300b9c961a70a7ec" + "reference": "1724ceff278daeeac5a006744633bacbb2dc4706" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4f00ee9e236fa6a48f4560d1300b9c961a70a7ec", - "reference": "4f00ee9e236fa6a48f4560d1300b9c961a70a7ec", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/1724ceff278daeeac5a006744633bacbb2dc4706", + "reference": "1724ceff278daeeac5a006744633bacbb2dc4706", "shasum": "" }, "require": { @@ -6863,9 +6863,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.18" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.19" }, - "time": "2023-05-23T02:31:11+00:00" + "time": "2023-07-15T19:42:19+00:00" }, { "name": "ralouphie/getallheaders", @@ -12783,16 +12783,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.21.1", + "version": "v3.22.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "229b55b3eae4729a8e2a321441ba40fcb3720b86" + "reference": "92b019f6c8d79aa26349d0db7671d37440dc0ff3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/229b55b3eae4729a8e2a321441ba40fcb3720b86", - "reference": "229b55b3eae4729a8e2a321441ba40fcb3720b86", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/92b019f6c8d79aa26349d0db7671d37440dc0ff3", + "reference": "92b019f6c8d79aa26349d0db7671d37440dc0ff3", "shasum": "" }, "require": { @@ -12802,7 +12802,7 @@ "doctrine/lexer": "^2 || ^3", "ext-json": "*", "ext-tokenizer": "*", - "php": "^8.0.1", + "php": "^7.4 || ^8.0", "sebastian/diff": "^4.0 || ^5.0", "symfony/console": "^5.4 || ^6.0", "symfony/event-dispatcher": "^5.4 || ^6.0", @@ -12816,6 +12816,7 @@ "symfony/stopwatch": "^5.4 || ^6.0" }, "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", "justinrainbow/json-schema": "^5.2", "keradus/cli-executor": "^2.0", "mikey179/vfsstream": "^1.6.11", @@ -12867,7 +12868,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.21.1" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.22.0" }, "funding": [ { @@ -12875,7 +12876,7 @@ "type": "github" } ], - "time": "2023-07-05T21:50:25+00:00" + "time": "2023-07-16T23:08:06+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -13155,44 +13156,39 @@ }, { "name": "mockery/mockery", - "version": "1.6.2", + "version": "1.6.3", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "13a7fa2642c76c58fa2806ef7f565344c817a191" + "reference": "b1be135c1ba7632f0248e07ee5e6e412576a309d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/13a7fa2642c76c58fa2806ef7f565344c817a191", - "reference": "13a7fa2642c76c58fa2806ef7f565344c817a191", + "url": "https://api.github.com/repos/mockery/mockery/zipball/b1be135c1ba7632f0248e07ee5e6e412576a309d", + "reference": "b1be135c1ba7632f0248e07ee5e6e412576a309d", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": "^7.4 || ^8.0" + "php": ">=7.4,<8.3" }, "conflict": { "phpunit/phpunit": "<8.0" }, "require-dev": { "phpunit/phpunit": "^8.5 || ^9.3", - "psalm/plugin-phpunit": "^0.18", - "vimeo/psalm": "^5.9" + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.13.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.6.x-dev" - } - }, "autoload": { "files": [ - "library/helpers.php", - "library/Mockery.php" + "src/helpers.php", + "src/Mockery.php" ], "psr-4": { - "Mockery\\": "library/Mockery" + "Mockery\\": "src/Mockery" } }, "notification-url": "https://packagist.org/downloads/", @@ -13203,12 +13199,20 @@ { "name": "Pádraic Brady", "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" + "homepage": "https://github.com/padraic", + "role": "Author" }, { "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], "description": "Mockery is a simple yet flexible PHP mock object framework", @@ -13226,10 +13230,13 @@ "testing" ], "support": { + "docs": "https://docs.mockery.io/", "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.6.2" + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" }, - "time": "2023-06-07T09:07:52+00:00" + "time": "2023-07-18T17:47:29+00:00" }, { "name": "myclabs/deep-copy", diff --git a/config/session.php b/config/session.php index 688340c9e2..a47294a8cb 100644 --- a/config/session.php +++ b/config/session.php @@ -158,4 +158,20 @@ return [ 'secure' => env('SECURE_COOKIES', false), + /* + |-------------------------------------------------------------------------- + | Bootstrap Table Storage Type + |-------------------------------------------------------------------------- + | + | Set the storage that this Bootstrap Table will use. + | Valid options are: + | - cookieStorage + | - localStorage: use this if you have a LOT of custom fields and are getting a REQUEST TOO LARGE error + | - sessionStorage + | + | More info: https://bootstrap-table.com/docs/extensions/cookie/#cookiestorage + */ + + 'bs_table_storage' => env('BS_TABLE_STORAGE', 'cookieStorage'), + ]; diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 586cb7186b..2445a351f3 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -424,4 +424,12 @@ class UserFactory extends Factory }); } + public function canEditOwnLocation() + { + return $this->state(function () { + return [ + 'permissions' => '{"self.edit_location":"1"}', + ]; + }); + } } diff --git a/database/migrations/2023_07_06_092507_add_phone_fax_to_locations.php b/database/migrations/2023_07_06_092507_add_phone_fax_to_locations.php new file mode 100644 index 0000000000..d6835ac295 --- /dev/null +++ b/database/migrations/2023_07_06_092507_add_phone_fax_to_locations.php @@ -0,0 +1,54 @@ +string('phone', 20)->after('zip')->nullable()->default(null); + $table->string('fax', 20)->after('zip')->nullable()->default(null); + }); + + Schema::table('companies', function (Blueprint $table) { + $table->string('phone', 20)->after('name')->nullable()->default(null); + $table->string('fax', 20)->after('name')->nullable()->default(null); + }); + + Schema::table('departments', function (Blueprint $table) { + $table->string('phone', 20)->after('name')->nullable()->default(null); + $table->string('fax', 20)->after('name')->nullable()->default(null); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('locations', function (Blueprint $table) { + $table->dropColumn('phone'); + $table->dropColumn('fax'); + }); + + Schema::table('companies', function (Blueprint $table) { + $table->dropColumn('phone'); + $table->dropColumn('fax'); + }); + + Schema::table('departments', function (Blueprint $table) { + $table->dropColumn('phone'); + $table->dropColumn('fax'); + }); + } +} diff --git a/database/migrations/2023_07_14_004221_add_show_in_list_view_to_custom_fields.php b/database/migrations/2023_07_14_004221_add_show_in_list_view_to_custom_fields.php new file mode 100644 index 0000000000..227a8bd6c3 --- /dev/null +++ b/database/migrations/2023_07_14_004221_add_show_in_list_view_to_custom_fields.php @@ -0,0 +1,34 @@ +boolean('show_in_listview')->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_listview')) { + $table->dropColumn('show_in_listview'); + } + }); + } +} diff --git a/package-lock.json b/package-lock.json index fdaaf3ad20..d4d32d4b60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "dependencies": { "@fortawesome/fontawesome-free": "^6.4.0", - "acorn": "^8.8.2", + "acorn": "^8.9.0", "acorn-import-assertions": "^1.9.0", "admin-lte": "^2.4.18", "ajv": "^6.12.6", @@ -15,7 +15,7 @@ "bootstrap-colorpicker": "^2.5.3", "bootstrap-datepicker": "^1.10.0", "bootstrap-less": "^3.3.8", - "bootstrap-table": "1.21.4", + "bootstrap-table": "1.22.0", "chart.js": "^2.9.4", "css-loader": "^4.0.0", "ekko-lightbox": "^5.1.1", @@ -35,7 +35,7 @@ "tableexport.jquery.plugin": "1.27.0", "tether": "^1.4.0", "vue-resource": "^1.5.2", - "webpack": "^5.83.1" + "webpack": "^5.87.0" }, "devDependencies": { "axios": "^0.27.2", @@ -2460,8 +2460,9 @@ } }, "node_modules/acorn": { - "version": "8.8.2", - "license": "MIT", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "bin": { "acorn": "bin/acorn" }, @@ -3531,8 +3532,9 @@ "license": "MIT" }, "node_modules/bootstrap-table": { - "version": "1.21.4", - "license": "MIT", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/bootstrap-table/-/bootstrap-table-1.22.0.tgz", + "integrity": "sha512-N1MLgPcIOa9cfwr7CaoLOekKJ9nHq/z8lk6LsC3mLUZq77VeMC/vTh+EqN7+iT8JADmoAsX7RqQbYfVxF9ZCig==", "peerDependencies": { "jquery": "3" } @@ -5195,9 +5197,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.1.tgz", - "integrity": "sha512-Vklwq2vDKtl0y/vtwjSesgJ5MYS7Etuk5txS8VdKL4AOS1aUlD96zqIfsOSLQsdv3xgMRbtkWM8eG9XDfKUPow==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -10940,9 +10942,9 @@ } }, "node_modules/webpack": { - "version": "5.86.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.86.0.tgz", - "integrity": "sha512-3BOvworZ8SO/D4GVP+GoRC3fVeg5MO4vzmq8TJJEkdmopxyazGDxN8ClqN12uzrZW9Tv8EED8v5VSb6Sqyi0pg==", + "version": "5.88.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", + "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.0", @@ -10953,7 +10955,7 @@ "acorn-import-assertions": "^1.9.0", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.14.1", + "enhanced-resolve": "^5.15.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -10963,7 +10965,7 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.2", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.7", "watchpack": "^2.4.0", @@ -11267,8 +11269,9 @@ } }, "node_modules/webpack/node_modules/schema-utils": { - "version": "3.1.2", - "license": "MIT", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", diff --git a/package.json b/package.json index efd0c1684c..4142ea1ee2 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "^6.4.0", - "acorn": "^8.8.2", + "acorn": "^8.9.0", "acorn-import-assertions": "^1.9.0", "admin-lte": "^2.4.18", "ajv": "^6.12.6", @@ -34,7 +34,7 @@ "bootstrap-colorpicker": "^2.5.3", "bootstrap-datepicker": "^1.10.0", "bootstrap-less": "^3.3.8", - "bootstrap-table": "1.21.4", + "bootstrap-table": "1.22.0", "chart.js": "^2.9.4", "css-loader": "^4.0.0", "ekko-lightbox": "^5.1.1", @@ -54,6 +54,6 @@ "tableexport.jquery.plugin": "1.27.0", "tether": "^1.4.0", "vue-resource": "^1.5.2", - "webpack": "^5.83.1" + "webpack": "^5.87.0" } } diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 0d8a199c62..ac1111ea74 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,4 +1,5 @@ { +<<<<<<< HEAD "/js/build/app.js": "/js/build/app.js?id=43fc984e5d0f901e04cef2474972e97f", "/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=392cc93cfc0be0349bab9697669dd091", "/css/build/overrides.css": "/css/build/overrides.css?id=eb013ebb79d92e25ce24b0c0b53185e4", @@ -19,6 +20,28 @@ "/css/dist/skins/skin-contrast.css": "/css/dist/skins/skin-contrast.css?id=f0fbbb0ac729ea092578fb05ca615460", "/css/dist/skins/skin-red.css": "/css/dist/skins/skin-red.css?id=b9a74ec0cd68f83e7480d5ae39919beb", "/css/dist/all.css": "/css/dist/all.css?id=15ac70d1eb588ad379df3e1911523048", +======= + "/js/build/app.js": "/js/build/app.js?id=82ddaa718cced6fb0be6e8db6f16a0c0", + "/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=f677207c6cf9678eb539abecb408c374", + "/css/build/overrides.css": "/css/build/overrides.css?id=5166569ede5a36802eadeea982686ca6", + "/css/build/app.css": "/css/build/app.css?id=b612c48e78fece2e1e8042ae24cc5f1e", + "/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=dc383f8560a8d4adb51d44fb4043e03b", + "/css/dist/skins/skin-orange.css": "/css/dist/skins/skin-orange.css?id=6f0563e726c2fe4fab4026daaa5bfdf2", + "/css/dist/skins/skin-orange-dark.css": "/css/dist/skins/skin-orange-dark.css?id=e6e53eef152bba01a4c666a4d8b01117", + "/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=07273f6ca3c698a39e8fc2075af4fa07", + "/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=c1f33574ecb9d3e69d9b8fe5bd68e101", + "/css/dist/skins/skin-yellow.css": "/css/dist/skins/skin-yellow.css?id=7b315b9612b8fde8f9c5b0ddb6bba690", + "/css/dist/skins/skin-purple-dark.css": "/css/dist/skins/skin-purple-dark.css?id=7d92dea45d94be7e1d4e427c728d335d", + "/css/dist/skins/skin-purple.css": "/css/dist/skins/skin-purple.css?id=6fe68325d5356197672c27bc77cedcb4", + "/css/dist/skins/skin-red-dark.css": "/css/dist/skins/skin-red-dark.css?id=8ca888bbc050d9680cbb65021382acba", + "/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=bdfc704731682c67645a2248b0b8d2d7", + "/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=76482123f6c70e866d6b971ba91de7bb", + "/css/dist/skins/skin-green-dark.css": "/css/dist/skins/skin-green-dark.css?id=e36e83c2aa3c3afdbb8ebe2c0309e91d", + "/css/dist/skins/skin-green.css": "/css/dist/skins/skin-green.css?id=0a82a6ae6bb4e58fe62d162c4fb50397", + "/css/dist/skins/skin-contrast.css": "/css/dist/skins/skin-contrast.css?id=da6c7997d9de2f8329142399f0ce50da", + "/css/dist/skins/skin-red.css": "/css/dist/skins/skin-red.css?id=44bf834f2110504a793dadec132a5898", + "/css/dist/all.css": "/css/dist/all.css?id=ae5d0ce9886bbe4ad4b021c6be19ec36", +>>>>>>> develop "/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7", "/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7", "/css/webfonts/fa-brands-400.ttf": "/css/webfonts/fa-brands-400.ttf?id=e2e2b1797606a266ed55549f5bb5a179", @@ -29,6 +52,7 @@ "/css/webfonts/fa-solid-900.woff2": "/css/webfonts/fa-solid-900.woff2?id=eea38615e7b5dbbaf88c263f2230cc32", "/css/webfonts/fa-v4compatibility.ttf": "/css/webfonts/fa-v4compatibility.ttf?id=6ebbf5afc34f54463abc2b81ca637364", "/css/webfonts/fa-v4compatibility.woff2": "/css/webfonts/fa-v4compatibility.woff2?id=67b8a78b7e80e805cfa4ee0421895ba4", +<<<<<<< HEAD "/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=2265e072e44c782c901dce8e037d97fc", "/js/build/vendor.js": "/js/build/vendor.js?id=8ac1d250496313e93744790e5138305d", "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=a0e44dba789031b34ef150a01318b865", @@ -48,4 +72,25 @@ "/css/dist/skins/skin-orange.min.css": "/css/dist/skins/skin-orange.min.css?id=268041e902b019730c23ee3875838005", "/css/dist/skins/skin-orange-dark.min.css": "/css/dist/skins/skin-orange-dark.min.css?id=d409d9b1a3b69247df8b98941ba06e33", "/css/dist/skins/skin-contrast.min.css": "/css/dist/skins/skin-contrast.min.css?id=f0fbbb0ac729ea092578fb05ca615460" +======= + "/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=f5935cf8eaf9c1f71da0c9245d730471", + "/js/build/vendor.js": "/js/build/vendor.js?id=3592e07ae9a6d1805a4ea3bd3c034aef", + "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=40e2dc8b5b29e244bb545f78e2a3242b", + "/js/dist/all.js": "/js/dist/all.js?id=ba07d399f23b294f7c4983030b757423", + "/css/dist/skins/skin-green.min.css": "/css/dist/skins/skin-green.min.css?id=0a82a6ae6bb4e58fe62d162c4fb50397", + "/css/dist/skins/skin-green-dark.min.css": "/css/dist/skins/skin-green-dark.min.css?id=e36e83c2aa3c3afdbb8ebe2c0309e91d", + "/css/dist/skins/skin-black.min.css": "/css/dist/skins/skin-black.min.css?id=76482123f6c70e866d6b971ba91de7bb", + "/css/dist/skins/skin-black-dark.min.css": "/css/dist/skins/skin-black-dark.min.css?id=bdfc704731682c67645a2248b0b8d2d7", + "/css/dist/skins/skin-blue.min.css": "/css/dist/skins/skin-blue.min.css?id=f677207c6cf9678eb539abecb408c374", + "/css/dist/skins/skin-blue-dark.min.css": "/css/dist/skins/skin-blue-dark.min.css?id=07273f6ca3c698a39e8fc2075af4fa07", + "/css/dist/skins/skin-yellow.min.css": "/css/dist/skins/skin-yellow.min.css?id=7b315b9612b8fde8f9c5b0ddb6bba690", + "/css/dist/skins/skin-yellow-dark.min.css": "/css/dist/skins/skin-yellow-dark.min.css?id=c1f33574ecb9d3e69d9b8fe5bd68e101", + "/css/dist/skins/skin-red.min.css": "/css/dist/skins/skin-red.min.css?id=44bf834f2110504a793dadec132a5898", + "/css/dist/skins/skin-red-dark.min.css": "/css/dist/skins/skin-red-dark.min.css?id=8ca888bbc050d9680cbb65021382acba", + "/css/dist/skins/skin-purple.min.css": "/css/dist/skins/skin-purple.min.css?id=6fe68325d5356197672c27bc77cedcb4", + "/css/dist/skins/skin-purple-dark.min.css": "/css/dist/skins/skin-purple-dark.min.css?id=7d92dea45d94be7e1d4e427c728d335d", + "/css/dist/skins/skin-orange.min.css": "/css/dist/skins/skin-orange.min.css?id=6f0563e726c2fe4fab4026daaa5bfdf2", + "/css/dist/skins/skin-orange-dark.min.css": "/css/dist/skins/skin-orange-dark.min.css?id=e6e53eef152bba01a4c666a4d8b01117", + "/css/dist/skins/skin-contrast.min.css": "/css/dist/skins/skin-contrast.min.css?id=da6c7997d9de2f8329142399f0ce50da" +>>>>>>> develop } diff --git a/resources/lang/en/admin/custom_fields/general.php b/resources/lang/en/admin/custom_fields/general.php index 1923aa7f4a..cb4ab3730a 100644 --- a/resources/lang/en/admin/custom_fields/general.php +++ b/resources/lang/en/admin/custom_fields/general.php @@ -51,4 +51,7 @@ return [ 'display_in_user_view_table' => 'Visible to User', 'auto_add_to_fieldsets' => 'Automatically add this to every new fieldset', 'add_to_preexisting_fieldsets' => 'Add to any existing fieldsets', + 'show_in_listview' => 'Show in list views by default. Authorized users will still be able to show/hide via the column selector.', + 'show_in_listview_short' => 'Show in lists', + ]; diff --git a/resources/lang/en/admin/hardware/general.php b/resources/lang/en/admin/hardware/general.php index 7201d37053..d413739e35 100644 --- a/resources/lang/en/admin/hardware/general.php +++ b/resources/lang/en/admin/hardware/general.php @@ -45,4 +45,5 @@ return [ 'alert_details' => 'Please see below for details.', 'custom_export' => 'Custom Export', 'mfg_warranty_lookup' => ':manufacturer Warranty Status Lookup', + 'user_department' => 'User Department', ]; diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index e41f3261c5..79cb87c474 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -413,7 +413,7 @@ return [ 'integration_option' => 'Integration Option', 'log_does_not_exist' => 'No matching log record exists.', 'merge_users' => 'Merge Users', - 'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licences, etc will be moved over to the selected user and the other users will be marked as deleted.', + 'merge_information' => 'This will merge the :count users into a single user. Select the user you wish to merge the others into below, and the associated assets, licenses, etc will be moved over to the selected user and the other users will be marked as deleted.', 'warning_merge_information' => 'This action CANNOT be undone and should ONLY be used when you need to merge users because of a bad import or sync. Be sure to run a backup first.', 'no_users_selected' => 'No users selected', 'not_enough_users_selected' => 'At least :count users must be selected', diff --git a/resources/views/accessories/view.blade.php b/resources/views/accessories/view.blade.php index b3798697be..86b4ee7730 100644 --- a/resources/views/accessories/view.blade.php +++ b/resources/views/accessories/view.blade.php @@ -287,7 +287,7 @@