From abcce789442a509c199c7bfdefc4afc747677004 Mon Sep 17 00:00:00 2001 From: Nicolai Essig Date: Fri, 20 Oct 2017 09:20:33 +0200 Subject: [PATCH 1/3] use translation for "All" in sidebar menu (#4268) --- resources/views/layouts/default.blade.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index d30dd16c8a..37077f908e 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -379,16 +379,16 @@ - All @lang('general.deployed') + @lang('general.all') @lang('general.deployed') - All @lang('general.ready_to_deploy') + @lang('general.all') @lang('general.ready_to_deploy') - All @lang('general.pending') - All @lang('general.undeployable') - All @lang('admin/hardware/general.archived') + @lang('general.all') @lang('general.pending') + @lang('general.all') @lang('general.undeployable') + @lang('general.all') @lang('admin/hardware/general.archived') @lang('admin/hardware/general.requestable')
  •  
  • From 189574377a8635f9f998c8a9a9c4813bbb76f5d3 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Fri, 20 Oct 2017 16:58:39 -0700 Subject: [PATCH 2/3] Add 'where' clause to hasManyThrough relationship. (#4276) --- app/Models/Location.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Location.php b/app/Models/Location.php index 37348bd4a8..c524c1eb30 100755 --- a/app/Models/Location.php +++ b/app/Models/Location.php @@ -54,7 +54,7 @@ class Location extends SnipeModel public function assets() { - return $this->hasManyThrough('\App\Models\Asset', '\App\Models\User', 'location_id', 'assigned_to', 'id'); + return $this->hasManyThrough('\App\Models\Asset', '\App\Models\User', 'location_id', 'assigned_to', 'id')->where("assets.assigned_type",User::class); } public function locationAssets() From 25d3d668803822b31c136b0333e7f10919ce7da8 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Fri, 20 Oct 2017 17:17:11 -0700 Subject: [PATCH 3/3] Add performance-improving indexes (#4278) --- ..._234129_add_location_indices_to_assets.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 database/migrations/2017_10_20_234129_add_location_indices_to_assets.php diff --git a/database/migrations/2017_10_20_234129_add_location_indices_to_assets.php b/database/migrations/2017_10_20_234129_add_location_indices_to_assets.php new file mode 100644 index 0000000000..eb36933f6a --- /dev/null +++ b/database/migrations/2017_10_20_234129_add_location_indices_to_assets.php @@ -0,0 +1,35 @@ +index('rtd_location_id'); + $table->index(['assigned_type','assigned_to']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('assets', function (Blueprint $table) { + // + $table->dropIndex(['rtd_location_id']); + $table->dropIndex(['assigned_type','assigned_to']); + }); + } +}