From e2bac62e36e7999281b42824a132ee157b6e4b78 Mon Sep 17 00:00:00 2001 From: madd15 Date: Sat, 14 Oct 2017 17:44:22 +1030 Subject: [PATCH 1/4] Fix #4205 (#4213) * Fixing various UI items * Revert css change * Dashboard icon CSS up 4px --- public/css/dist/all.css | Bin 253683 -> 253683 bytes resources/views/hardware/checkin.blade.php | 2 +- resources/views/hardware/history.blade.php | 2 +- resources/views/layouts/default.blade.php | 11 +++++------ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/public/css/dist/all.css b/public/css/dist/all.css index 8f93662babd5c8bdb208116069d4c1aef5514f31..ec1e27d267085374daf3b352acc1003fbe5adc5b 100644 GIT binary patch delta 25 hcmeyom;du#{)QIDEleJ6j3(`#ZcN)f-I!O+004_h37`M~ delta 25 hcmeyom;du#{)QIDEleJ6j0WwVZcN)f-I!O+004^~37h}` diff --git a/resources/views/hardware/checkin.blade.php b/resources/views/hardware/checkin.blade.php index bf365b958c..cb89ee82b8 100755 --- a/resources/views/hardware/checkin.blade.php +++ b/resources/views/hardware/checkin.blade.php @@ -93,7 +93,7 @@ diff --git a/resources/views/hardware/history.blade.php b/resources/views/hardware/history.blade.php index ded1cdc3ca..ebab4fe7e6 100644 --- a/resources/views/hardware/history.blade.php +++ b/resources/views/hardware/history.blade.php @@ -61,7 +61,7 @@ @endif

- 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 Admin < Settings. + 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 Admin > General Settings.

Fields included in the CSV must match the headers: Date, Tag, Name. Any additional fields will be ignored.

diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index 5f9b415a7b..7d327edb5b 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -379,18 +379,17 @@ - All @lang('general.deployed') + All @lang('general.deployed') - - All @lang('general.ready_to_deploy') + All @lang('general.ready_to_deploy') - All @lang('general.pending') + All @lang('general.pending') All @lang('general.undeployable') - All @lang('admin/hardware/general.archived') - @lang('admin/hardware/general.requestable') + All @lang('admin/hardware/general.archived') + @lang('admin/hardware/general.requestable')
  •  
  • @can('checkout', \App\Models\Asset::class) From c0b39701cca793084d4e8357d26943fb407f02a2 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 14 Oct 2017 16:17:14 -0700 Subject: [PATCH 2/4] Fixes #4170 - asset maintenance type not showing --- resources/views/suppliers/view.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/suppliers/view.blade.php b/resources/views/suppliers/view.blade.php index 368942283d..a1e5525ec2 100755 --- a/resources/views/suppliers/view.blade.php +++ b/resources/views/suppliers/view.blade.php @@ -201,11 +201,11 @@ @if (is_null($improvement->deleted_at)) {{ $improvement->asset->name }} - {{ $improvement->improvement_type }} + {{ $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') }} - {{ sprintf( trans( 'general.currency' ) . '%01.2f', $improvement->cost) }} + {{ sprintf( $snipeSettings->default_currency. '%01.2f', $improvement->cost) }} cost; ?> @@ -222,7 +222,7 @@ - {{sprintf(trans( 'general.currency' ) . '%01.2f', $totalCost)}} + {{sprintf($snipeSettings->default_currency . '%01.2f', $totalCost)}} From 22e9246031e5c2ce1b41ff17cbc2187b8a288590 Mon Sep 17 00:00:00 2001 From: Daniel Meltzer Date: Mon, 16 Oct 2017 02:32:40 -0400 Subject: [PATCH 3/4] Fix more old routes. Should fix #4216 (#4217) --- app/Http/Controllers/CategoriesController.php | 16 +++++++--------- app/Http/Controllers/DepartmentsController.php | 17 ++++------------- app/Http/Controllers/LocationsController.php | 6 ++---- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/app/Http/Controllers/CategoriesController.php b/app/Http/Controllers/CategoriesController.php index 99504d3c69..b502050e6a 100755 --- a/app/Http/Controllers/CategoriesController.php +++ b/app/Http/Controllers/CategoriesController.php @@ -98,10 +98,8 @@ class CategoriesController extends Controller */ public function edit($categoryId = null) { - // Check if the category exists if (is_null($item = Category::find($categoryId))) { - // Redirect to the blogs management page - return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.does_not_exist')); + return redirect()->route('categories.index')->with('error', trans('admin/categories/message.does_not_exist')); } $category_types= Helper::categoryTypeList(); @@ -158,22 +156,22 @@ class CategoriesController extends Controller { // Check if the category exists if (is_null($category = Category::find($categoryId))) { - return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.not_found')); + return redirect()->route('categories.index')->with('error', trans('admin/categories/message.not_found')); } if ($category->has_models() > 0) { - return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'model'])); + return redirect()->route('categories.index')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'model'])); } elseif ($category->accessories()->count() > 0) { - return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'accessory'])); + return redirect()->route('categories.index')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'accessory'])); } elseif ($category->consumables()->count() > 0) { - return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'consumable'])); + return redirect()->route('categories.index')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'consumable'])); } elseif ($category->components()->count() > 0) { - return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'component'])); + return redirect()->route('categories.index')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'component'])); } $category->delete(); // Redirect to the locations management page - return redirect()->to(route('categories.index'))->with('success', trans('admin/categories/message.delete.success')); + return redirect()->route('categories.index')->with('success', trans('admin/categories/message.delete.success')); } diff --git a/app/Http/Controllers/DepartmentsController.php b/app/Http/Controllers/DepartmentsController.php index d5050e8286..a78e2cecf0 100644 --- a/app/Http/Controllers/DepartmentsController.php +++ b/app/Http/Controllers/DepartmentsController.php @@ -27,13 +27,11 @@ class DepartmentsController extends Controller public function index(Request $request) { $this->authorize('index', Department::class); + $company = null; if ($request->has('company_id')) { $company = Company::find($request->input('company_id')); - } else { - $company = null; } - return view('departments/index')->with('company',$company); - + return view('departments/index')->with('company', $company); } @@ -53,12 +51,10 @@ class DepartmentsController extends Controller $department->user_id = Auth::user()->id; $department->manager_id = ($request->has('manager_id' ) ? $request->input('manager_id') : null); - if ($department->save()) { return redirect()->route("departments.index")->with('success', trans('admin/departments/message.create.success')); } return redirect()->back()->withInput()->withErrors($department->getErrors()); - } /** @@ -140,25 +136,20 @@ class DepartmentsController extends Controller ->with('location_list', Helper::locationsList()) ->with('company_list', Helper::companyList()); } - - + public function update(Request $request, $id) { $this->authorize('create', Department::class); if (is_null($department = Department::find($id))) { - return redirect()->to('admin/settings/departments')->with('error', trans('admin/departments/message.does_not_exist')); + return redirect()->route('departments.index')->with('error', trans('admin/departments/message.does_not_exist')); } - $department->fill($request->all()); $department->manager_id = ($request->has('manager_id' ) ? $request->input('manager_id') : null); if ($department->save()) { return redirect()->route("departments.index")->with('success', trans('admin/departments/message.update.success')); } - return redirect()->back()->withInput()->withErrors($department->getErrors()); } - - } diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.php index 4abdfa65e1..ffe480c63f 100755 --- a/app/Http/Controllers/LocationsController.php +++ b/app/Http/Controllers/LocationsController.php @@ -148,7 +148,7 @@ class LocationsController extends Controller { // Check if the location exists if (is_null($item = Location::find($locationId))) { - return redirect()->to('admin/settings/locations')->with('error', trans('admin/locations/message.does_not_exist')); + return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist')); } // Show the page @@ -157,7 +157,6 @@ class LocationsController extends Controller $location_options = Location::flattenLocationsArray($location_options_array); $location_options = array('' => 'Top Level') + $location_options; - return view('locations/edit', compact('item')) ->with('location_options', $location_options) ->with('manager_list', Helper::managerList()); @@ -177,7 +176,7 @@ class LocationsController extends Controller { // Check if the location exists if (is_null($location = Location::find($locationId))) { - return redirect()->to('admin/settings/locations')->with('error', trans('admin/locations/message.does_not_exist')); + return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist')); } // Update the location data @@ -218,7 +217,6 @@ class LocationsController extends Controller return redirect()->to(route('locations.index'))->with('error', trans('admin/locations/message.not_found')); } - if ($location->users->count() > 0) { return redirect()->to(route('locations.index'))->with('error', trans('admin/locations/message.assoc_users')); } elseif ($location->childLocations->count() > 0) { From 56cbc005aef5a44b6da198298994e8f00201d988 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 16 Oct 2017 05:01:15 -0700 Subject: [PATCH 4/4] Fixes expected checkins name in console kernel --- app/Console/Kernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index e104abb08a..0f81098b19 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -40,7 +40,7 @@ class Kernel extends ConsoleKernel $schedule->command('snipeit:inventory-alerts')->daily(); $schedule->command('snipeit:expiring-alerts')->daily(); - $schedule->command('snipeit:expected-checkins')->daily(); + $schedule->command('snipeit:expected-checkin')->daily(); $schedule->command('snipeit:backup')->weekly(); $schedule->command('backup:clean')->daily(); }