Merge branch 'develop' of github.com:snipe/snipe-it into develop
This commit is contained in:
commit
b215924b1a
3 changed files with 41 additions and 6 deletions
|
@ -54,7 +54,7 @@ class Location extends SnipeModel
|
||||||
|
|
||||||
public function assets()
|
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()
|
public function locationAssets()
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class AddLocationIndicesToAssets extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('assets', function (Blueprint $table) {
|
||||||
|
$table->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']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -379,16 +379,16 @@
|
||||||
|
|
||||||
|
|
||||||
<li{!! (Request::query('status') == 'Deployed' ? ' class="active"' : '') !!}>
|
<li{!! (Request::query('status') == 'Deployed' ? ' class="active"' : '') !!}>
|
||||||
<a href="{{ url('hardware?status=Deployed') }}"><i class="fa fa-circle-o text-blue"></i>All @lang('general.deployed')
|
<a href="{{ url('hardware?status=Deployed') }}"><i class="fa fa-circle-o text-blue"></i>@lang('general.all') @lang('general.deployed')
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li{!! (Request::query('status') == 'RTD' ? ' class="active"' : '') !!}>
|
<li{!! (Request::query('status') == 'RTD' ? ' class="active"' : '') !!}>
|
||||||
<a href="{{ url('hardware?status=RTD') }}">
|
<a href="{{ url('hardware?status=RTD') }}">
|
||||||
<i class="fa fa-circle-o text-green"></i>All @lang('general.ready_to_deploy')</a>
|
<i class="fa fa-circle-o text-green"></i>@lang('general.all') @lang('general.ready_to_deploy')</a>
|
||||||
</li>
|
</li>
|
||||||
<li{!! (Request::query('status') == 'Pending' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Pending') }}"><i class="fa fa-circle-o text-orange"></i>All @lang('general.pending')</a></li>
|
<li{!! (Request::query('status') == 'Pending' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Pending') }}"><i class="fa fa-circle-o text-orange"></i>@lang('general.all') @lang('general.pending')</a></li>
|
||||||
<li{!! (Request::query('status') == 'Undeployable' ? ' class="active"' : '') !!} ><a href="{{ url('hardware?status=Undeployable') }}"><i class="fa fa-times text-red"></i>All @lang('general.undeployable')</a></li>
|
<li{!! (Request::query('status') == 'Undeployable' ? ' class="active"' : '') !!} ><a href="{{ url('hardware?status=Undeployable') }}"><i class="fa fa-times text-red"></i>@lang('general.all') @lang('general.undeployable')</a></li>
|
||||||
<li{!! (Request::query('status') == 'Archived' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Archived') }}"><i class="fa fa-times text-red"></i>All @lang('admin/hardware/general.archived')</a></li>
|
<li{!! (Request::query('status') == 'Archived' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Archived') }}"><i class="fa fa-times text-red"></i>@lang('general.all') @lang('admin/hardware/general.archived')</a></li>
|
||||||
<li{!! (Request::query('status') == 'Requestable' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Requestable') }}"><i class="fa fa-check text-blue"></i>@lang('admin/hardware/general.requestable')</a></li>
|
<li{!! (Request::query('status') == 'Requestable' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Requestable') }}"><i class="fa fa-check text-blue"></i>@lang('admin/hardware/general.requestable')</a></li>
|
||||||
|
|
||||||
<li class="divider"> </li>
|
<li class="divider"> </li>
|
||||||
|
|
Loading…
Add table
Reference in a new issue