From 954b54f9148c070c5f7fab054da05f6b431b921f Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 14 Jun 2022 15:06:04 -0700 Subject: [PATCH 1/6] Removed duplicated $allowed_columns Signed-off-by: snipe --- app/Http/Controllers/Api/AccessoriesController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/AccessoriesController.php b/app/Http/Controllers/Api/AccessoriesController.php index f386c8e72..a894dc376 100644 --- a/app/Http/Controllers/Api/AccessoriesController.php +++ b/app/Http/Controllers/Api/AccessoriesController.php @@ -27,8 +27,7 @@ class AccessoriesController extends Controller public function index(Request $request) { $this->authorize('view', Accessory::class); - $allowed_columns = ['id', 'name', 'model_number', 'eol', 'notes', 'created_at', 'min_amt', 'company_id']; - + // This array is what determines which fields should be allowed to be sorted on ON the table itself, no relations // Relations will be handled in query scopes a little further down. $allowed_columns = From aea9dd1de5b551075d8d9d91bac0a35eef51aa5f Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 14 Jun 2022 16:06:56 -0700 Subject: [PATCH 2/6] Improved suplpiers UI Signed-off-by: snipe --- resources/views/suppliers/view.blade.php | 483 +++++++++++------------ 1 file changed, 236 insertions(+), 247 deletions(-) diff --git a/resources/views/suppliers/view.blade.php b/resources/views/suppliers/view.blade.php index d4c95ff0c..2282d8926 100755 --- a/resources/views/suppliers/view.blade.php +++ b/resources/views/suppliers/view.blade.php @@ -1,294 +1,283 @@ @extends('layouts/default') + {{-- Page title --}} @section('title') -{{ trans('admin/suppliers/table.view') }} - -{{ $supplier->name }} -@parent + + {{ trans('admin/suppliers/table.view') }} - + {{ $supplier->name }} + + @parent @stop @section('header_right') - - {{ trans('admin/suppliers/table.update') }} + + {{ trans('admin/suppliers/table.update') }} + + {{ trans('general.back') }} + @stop + {{-- Page content --}} @section('content') -
-
+
+
+ + + + +
- -
- - @if ($supplier->id) -
-
-

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

-
-
- @endif - -
-
- - - - - -
-
-
-
- - - -
- - @if ($supplier->id) -
-
-

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

+ @if (($supplier->address!='') && ($supplier->state!='') && ($supplier->country!='') && (config('services.google.maps_api_key'))) +
+ Map
-
@endif -
-
- - - - - - - - - - - - - - - @if ($supplier->asset_maintenances) - @foreach ($supplier->asset_maintenances as $improvement) - @if (is_null($improvement->deleted_at)) - - - - - - - - cost; ?> - - - @endif - @endforeach + +
    + @if ($supplier->contact!='') +
  • {{ $supplier->contact }}
  • + @endif + @if ($supplier->phone!='') +
  • + {{ $supplier->phone }} +
  • + @endif + @if ($supplier->fax!='') +
  • {{ $supplier->fax }}
  • @endif -
- - - - - - - - - - -
{{ trans('admin/asset_maintenances/table.asset_name') }}{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}{{ trans('admin/asset_maintenances/form.start_date') }}{{ trans('admin/asset_maintenances/form.completion_date') }}{{ trans('admin/asset_maintenances/table.is_warranty') }}{{ trans('admin/asset_maintenances/form.cost') }}{{ trans('table.actions') }}
- @if ($improvement->asset) - {{ $improvement->asset->name }} - @else - (deleted asset) - @endif - {{ $improvement->asset_maintenance_type }}{{ $improvement->start_date }}{{ $improvement->completion_date }}{{ $improvement->is_warranty ? trans('admin/asset_maintenances/message.warranty') : trans('admin/asset_maintenances/message.not_warranty') }}{{ $snipeSettings->default_currency. ' '. Helper::formatCurrencyOutput($improvement->cost) }} -
{{ $snipeSettings->default_currency . ' '.Helper::formatCurrencyOutput($totalCost) }}
-
-
-
-
+ @if ($supplier->email!='') +
  • + + + {{ $supplier->email }} + +
  • + @endif - -
    + @if ($supplier->url!='') +
  • + + {{ $supplier->url }} +
  • + @endif - @if (($supplier->state!='') && ($supplier->country!='') && (config('services.google.maps_api_key'))) -
    - Map -
    - @endif + @if ($supplier->address!='') +

  • + {{ $supplier->address }} + @if ($supplier->address2) +
    + {{ $supplier->address2 }} + @endif + @if (($supplier->city) || ($supplier->state)) +
    + {{ $supplier->city }} {{ strtoupper($supplier->state) }} {{ $supplier->zip }} {{ strtoupper($supplier->country) }} + @endif +
  • + @endif -
      - @if ($supplier->contact) -
    • {{ $supplier->contact }}
    • - @endif - @if ($supplier->phone) -
    • - {{ $supplier->phone }} -
    • - @endif - @if ($supplier->fax) -
    • {{ $supplier->fax }}
    • - @endif + @if ($supplier->notes!='') +
    • {{ $supplier->notes }}
    • + @endif - @if ($supplier->email) -
    • - - - {{ $supplier->email }} - -
    • - @endif - - @if ($supplier->url) -
    • - - {{ $supplier->url }} -
    • - @endif - - @if ($supplier->address) -

    • - {{ $supplier->address }} - - @if ($supplier->address2) -
      - {{ $supplier->address2 }} - @endif - @if (($supplier->city) || ($supplier->state)) -
      - {{ $supplier->city }} {{ strtoupper($supplier->state) }} {{ $supplier->zip }} {{ strtoupper($supplier->country) }} - @endif -
    • - @endif - - @if ($supplier->notes) -
    • {{ $supplier->notes }}
    • - @endif - -
    - @if ($supplier->image!='') -
    - {{ $supplier->name }} -
    - @endif - -
    -
    + + @if ($supplier->image!='') +
    + {{ $supplier->name }} +
    + @endif +
    +
    +
    @stop + @section('moar_scripts') @include ('partials.bootstrap-table', [ - 'showFooter' => true, - ]) + 'exportFile' => 'locations-export', + 'search' => true + ]) + @stop From bfec0059c5c563f2f8bf290f24e3ff39e2f1889e Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 14 Jun 2022 16:10:36 -0700 Subject: [PATCH 3/6] Improved manufacturers UI Signed-off-by: snipe --- resources/views/manufacturers/view.blade.php | 54 ++++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/resources/views/manufacturers/view.blade.php b/resources/views/manufacturers/view.blade.php index dc1d71f8a..d7725bc49 100644 --- a/resources/views/manufacturers/view.blade.php +++ b/resources/views/manufacturers/view.blade.php @@ -9,6 +9,10 @@ @stop @section('header_right') + + {{ trans('general.back') }} + +