Merge branch 'develop'

This commit is contained in:
snipe 2017-11-02 08:44:40 -07:00
commit 6f886d3d6e
3 changed files with 11 additions and 5 deletions

View file

@ -90,7 +90,7 @@ class AssetModelsController extends Controller
if (Input::file('image')) { if (Input::file('image')) {
$image = Input::file('image'); $image = Input::file('image');
$file_name = slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension(); $file_name = str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
$path = public_path('uploads/models/'); $path = public_path('uploads/models/');
if ($image->getClientOriginalExtension()!='svg') { if ($image->getClientOriginalExtension()!='svg') {

View file

@ -872,7 +872,7 @@ class Asset extends Depreciable
} }
if ($fieldname =='location') { if ($fieldname =='location') {
$query->whereHas('defaultLoc', function ($query) use ($search_val) { $query->whereHas('location', function ($query) use ($search_val) {
$query->where('locations.name', 'LIKE', '%' . $search_val . '%'); $query->where('locations.name', 'LIKE', '%' . $search_val . '%');
}); });
} }
@ -935,8 +935,11 @@ class Asset extends Depreciable
} }
} }
if ($fieldname!='category') {
$query->orWhere('assets.'.$fieldname, 'LIKE', '%' . $search_val . '%');
}
$query->orWhere('assets.'.$fieldname, 'LIKE', '%' . $search_val . '%');
}); });

View file

@ -48,12 +48,14 @@
</thead> </thead>
<tbody> <tbody>
@foreach ($requestedItems as $request) @foreach ($requestedItems as $request)
@if ($request->requestable)
<tr> <tr>
{{ csrf_field() }} {{ csrf_field() }}
<td> <td>
@if ($request->itemType() == "asset") @if (($request->itemType() == "asset") && ($request->requestable))
<a href="{{ $request->requestable->getImageUrl() }}" data-toggle="lightbox" data-type="image"><img src="{{ $request->requestable->getImageUrl() }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive"></a> <a href="{{ $request->requestable->getImageUrl() }}" data-toggle="lightbox" data-type="image"><img src="{{ $request->requestable->getImageUrl() }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive"></a>
@else @elseif (($request->itemType() == "asset_model") && ($request->requestable))
<a href="{{ url('/') }}/uploads/models/{{ $request->requestable->image }}" data-toggle="lightbox" data-type="image"><img src="{{ url('/') }}/uploads/models/{{ $request->requestable->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive"></a> <a href="{{ url('/') }}/uploads/models/{{ $request->requestable->image }}" data-toggle="lightbox" data-type="image"><img src="{{ url('/') }}/uploads/models/{{ $request->requestable->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive"></a>
@endif @endif
@ -102,6 +104,7 @@
</tr> </tr>
@endif
@endforeach @endforeach
</tbody> </tbody>
</table> </table>