2016-03-25 01:18:05 -07:00
|
|
|
@extends('layouts/default')
|
|
|
|
|
|
|
|
{{-- Page title --}}
|
|
|
|
@section('title')
|
|
|
|
{{ trans('admin/hardware/general.view') }} {{ $asset->asset_tag }}
|
|
|
|
@parent
|
|
|
|
@stop
|
|
|
|
|
|
|
|
{{-- Right header --}}
|
|
|
|
@section('header_right')
|
2018-05-02 14:13:06 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@can('manage', \App\Models\Asset::class)
|
2016-03-25 01:18:05 -07:00
|
|
|
<div class="dropdown pull-right">
|
|
|
|
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
|
2016-12-27 12:03:47 -08:00
|
|
|
<span class="caret"></span>
|
2016-03-25 01:18:05 -07:00
|
|
|
</button>
|
|
|
|
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1">
|
2017-06-09 00:35:23 -07:00
|
|
|
@if (($asset->assetstatus) && ($asset->assetstatus->deployable=='1'))
|
2016-12-27 12:03:47 -08:00
|
|
|
@if ($asset->assigned_to != '')
|
2018-02-21 15:51:04 -08:00
|
|
|
@can('checkin', \App\Models\Asset::class)
|
2016-12-27 12:03:47 -08:00
|
|
|
<li role="presentation"><a href="{{ route('checkin/hardware', $asset->id) }}">{{ trans('admin/hardware/general.checkin') }}</a></li>
|
2018-02-21 15:51:04 -08:00
|
|
|
@endcan
|
2016-12-27 12:03:47 -08:00
|
|
|
@else
|
2018-02-21 15:51:04 -08:00
|
|
|
@can('checkout', \App\Models\Asset::class)
|
2016-12-27 12:03:47 -08:00
|
|
|
<li role="presentation"><a href="{{ route('checkout/hardware', $asset->id) }}">{{ trans('admin/hardware/general.checkout') }}</a></li>
|
2018-02-21 15:51:04 -08:00
|
|
|
@endcan
|
2016-06-02 14:04:54 -07:00
|
|
|
@endif
|
2016-12-27 12:03:47 -08:00
|
|
|
@endif
|
2018-03-29 11:28:37 -07:00
|
|
|
@can('update', \App\Models\Asset::class)
|
2016-12-27 12:03:47 -08:00
|
|
|
<li role="presentation"><a href="{{ route('hardware.edit', $asset->id) }}">{{ trans('admin/hardware/general.edit') }}</a></li>
|
2018-02-21 15:51:04 -08:00
|
|
|
@endcan
|
|
|
|
@can('create', \App\Models\Asset::class)
|
2016-12-27 12:03:47 -08:00
|
|
|
<li role="presentation"><a href="{{ route('clone/hardware', $asset->id) }}">{{ trans('admin/hardware/general.clone') }}</a></li>
|
2018-02-21 15:51:04 -08:00
|
|
|
@endcan
|
|
|
|
@can('audit', \App\Models\Asset::class)
|
2017-08-25 10:04:19 -07:00
|
|
|
<li role="presentation"><a href="{{ route('asset.audit.create', $asset->id) }}">{{ trans('general.audit') }}</a></li>
|
2018-02-21 15:51:04 -08:00
|
|
|
@endcan
|
2016-03-25 01:18:05 -07:00
|
|
|
</ul>
|
|
|
|
</div>
|
2016-12-27 12:03:47 -08:00
|
|
|
@endcan
|
2016-03-25 01:18:05 -07:00
|
|
|
@stop
|
|
|
|
|
|
|
|
{{-- Page content --}}
|
|
|
|
@section('content')
|
2018-02-16 13:22:55 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
<div class="row">
|
2018-02-16 18:04:11 -08:00
|
|
|
|
|
|
|
@if (!$asset->model)
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="callout callout-danger">
|
|
|
|
<h4>NO MODEL ASSOCIATED</h4>
|
|
|
|
<p>This will break things in weird and horrible ways. Edit this asset now to assign it a model. </p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2017-12-12 02:31:26 -08:00
|
|
|
@if ($asset->deleted_at!='')
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
<i class="fa fa-exclamation-circle faa-pulse animated"></i>
|
|
|
|
<strong>WARNING: </strong>
|
|
|
|
This asset has been deleted.
|
|
|
|
You must <a href="{{ route('restore/hardware', $asset->id) }}">restore it</a> before you can assign it to someone.
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
<div class="col-md-12">
|
|
|
|
|
|
|
|
|
2017-12-12 02:31:26 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
<!-- Custom Tabs -->
|
|
|
|
<div class="nav-tabs-custom">
|
|
|
|
<ul class="nav nav-tabs">
|
|
|
|
<li class="active">
|
2018-01-22 13:14:52 -08:00
|
|
|
<a href="#details" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-info-circle"></i></span> <span class="hidden-xs hidden-sm">{{ trans('general.details') }}</span></a>
|
2016-03-25 01:18:05 -07:00
|
|
|
</li>
|
|
|
|
<li>
|
2018-01-10 05:42:34 -08:00
|
|
|
<a href="#software" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-floppy-o"></i></span> <span class="hidden-xs hidden-sm">{{ trans('general.licenses') }}</span></a>
|
2016-03-25 01:18:05 -07:00
|
|
|
</li>
|
2016-08-16 18:49:54 -07:00
|
|
|
<li>
|
2018-01-10 05:42:34 -08:00
|
|
|
<a href="#components" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-hdd-o"></i></span> <span class="hidden-xs hidden-sm">{{ trans('general.components') }}</span></a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#assets" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-barcode"></i></span> <span class="hidden-xs hidden-sm">{{ trans('general.assets') }}</span></a>
|
2016-08-16 18:49:54 -07:00
|
|
|
</li>
|
2016-03-25 01:18:05 -07:00
|
|
|
<li>
|
2018-01-22 13:14:52 -08:00
|
|
|
<a href="#maintenances" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-wrench"></i></span> <span class="hidden-xs hidden-sm">{{ trans('general.maintenances') }}</span></a>
|
2016-03-25 01:18:05 -07:00
|
|
|
</li>
|
|
|
|
<li>
|
2018-01-10 05:42:34 -08:00
|
|
|
<a href="#history" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-history"></i></span> <span class="hidden-xs hidden-sm">{{ trans('general.history') }}</span></a>
|
2016-03-25 01:18:05 -07:00
|
|
|
</li>
|
|
|
|
<li>
|
2018-01-22 13:14:52 -08:00
|
|
|
<a href="#files" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-files-o"></i></span> <span class="hidden-xs hidden-sm">{{ trans('general.files') }}</span></a>
|
2016-03-25 01:18:05 -07:00
|
|
|
</li>
|
2018-07-16 20:09:53 -07:00
|
|
|
@can('update', \App\Models\Asset::class)
|
|
|
|
<li class="pull-right"><a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
|
|
|
<i class="fa fa-paperclip"></i> {{ trans('button.upload') }}</a>
|
2016-08-16 18:49:54 -07:00
|
|
|
</li>
|
2018-07-16 20:09:53 -07:00
|
|
|
@endcan
|
2016-03-25 01:18:05 -07:00
|
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane fade in active" id="details">
|
|
|
|
<div class="row">
|
2016-08-16 18:49:54 -07:00
|
|
|
<div class="col-md-8">
|
|
|
|
<div class="table-responsive" style="margin-top: 10px;">
|
|
|
|
<table class="table">
|
2016-03-25 01:18:05 -07:00
|
|
|
<tbody>
|
2016-12-27 12:03:47 -08:00
|
|
|
@if ($asset->assetstatus)
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('general.status') }}</td>
|
|
|
|
<td>
|
2017-11-30 16:40:37 -08:00
|
|
|
|
|
|
|
@if (($asset->assignedTo) && ($asset->deleted_at==''))
|
2018-01-15 21:03:26 -08:00
|
|
|
<i class="fa fa-circle text-blue"></i>
|
|
|
|
{{ $asset->assetstatus->name }}
|
|
|
|
<label class="label label-default">{{ trans('general.deployed') }}</label>
|
|
|
|
|
|
|
|
<i class="fa fa-long-arrow-right" aria-hidden="true"></i>
|
|
|
|
{!! $asset->assignedTo->present()->glyph() !!}
|
2017-11-30 16:40:37 -08:00
|
|
|
{!! $asset->assignedTo->present()->nameUrl() !!}
|
|
|
|
@else
|
|
|
|
@if (($asset->assetstatus) && ($asset->assetstatus->deployable=='1'))
|
|
|
|
<i class="fa fa-circle text-green"></i>
|
|
|
|
@elseif (($asset->assetstatus) && ($asset->assetstatus->pending=='1'))
|
|
|
|
<i class="fa fa-circle text-orange"></i>
|
|
|
|
@elseif (($asset->assetstatus) && ($asset->assetstatus->archived=='1'))
|
|
|
|
<i class="fa fa-times text-red"></i>
|
|
|
|
@endif
|
|
|
|
<a href="{{ route('statuslabels.show', $asset->assetstatus->id) }}">
|
|
|
|
{{ $asset->assetstatus->name }}</a>
|
|
|
|
<label class="label label-default">{{ $asset->present()->statusMeta }}</label>
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
2016-10-31 17:44:39 -07:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
@if ($asset->company)
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr>
|
|
|
|
<td>{{ trans('general.company') }}</td>
|
2017-02-21 14:26:46 -08:00
|
|
|
<td><a href="{{ url('/companies/' . $asset->company->id) }}">{{ $asset->company->name }}</a></td>
|
2016-12-27 12:03:47 -08:00
|
|
|
</tr>
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
2016-12-27 12:03:47 -08:00
|
|
|
|
2016-06-15 11:50:57 -07:00
|
|
|
@if ($asset->name)
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/hardware/form.name') }}</td>
|
|
|
|
<td>{{ $asset->name }}</td>
|
|
|
|
</tr>
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
2016-12-27 12:03:47 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
@if ($asset->serial)
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/hardware/form.serial') }}</td>
|
|
|
|
<td>{{ $asset->serial }}</td>
|
|
|
|
</tr>
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
2017-08-25 10:18:18 -07:00
|
|
|
@if ((isset($audit_log)) && ($audit_log->created_at))
|
2016-08-16 18:49:54 -07:00
|
|
|
<tr>
|
2017-08-25 10:04:19 -07:00
|
|
|
<td>{{ trans('general.last_audit') }}</td>
|
|
|
|
<td> {{ \App\Helpers\Helper::getFormattedDateObject($audit_log->created_at, 'date', false) }} (by {{ link_to_route('users.show', $audit_log->user->present()->fullname(), [$audit_log->user->id]) }})</td>
|
2016-08-16 18:49:54 -07:00
|
|
|
</tr>
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
2017-08-25 10:04:19 -07:00
|
|
|
@if ($asset->next_audit_date)
|
2016-08-16 18:49:54 -07:00
|
|
|
<tr>
|
2017-08-25 10:04:19 -07:00
|
|
|
<td>{{ trans('general.next_audit_date') }}</td>
|
|
|
|
<td> {{ \App\Helpers\Helper::getFormattedDateObject($asset->next_audit_date, 'date', false) }}</td>
|
2016-08-16 18:49:54 -07:00
|
|
|
</tr>
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
2016-10-12 12:48:37 -07:00
|
|
|
|
2018-02-16 18:04:11 -08:00
|
|
|
@if (($asset->model) && ($asset->model->manufacturer))
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/hardware/form.manufacturer') }}</td>
|
|
|
|
<td>
|
2017-12-12 04:31:53 -08:00
|
|
|
<ul class="list-unstyled" style="line-height: 25px;">
|
|
|
|
@can('view', \App\Models\Manufacturer::class)
|
2017-03-10 22:08:59 -08:00
|
|
|
|
2017-12-12 04:31:53 -08:00
|
|
|
<li><a href="{{ route('manufacturers.show', $asset->model->manufacturer->id) }}">
|
|
|
|
{{ $asset->model->manufacturer->name }}</li>
|
|
|
|
</a>
|
|
|
|
@else
|
|
|
|
<li> {{ $asset->model->manufacturer->name }}</li>
|
|
|
|
@endcan
|
2016-10-12 12:48:37 -07:00
|
|
|
|
2018-02-16 18:04:11 -08:00
|
|
|
@if (($asset->model) && ($asset->model->manufacturer->url))
|
2017-12-12 04:31:53 -08:00
|
|
|
<li><i class="fa fa-globe"></i> <a href="{{ $asset->model->manufacturer->url }}">{{ $asset->model->manufacturer->url }}</a></li>
|
|
|
|
@endif
|
2016-10-12 12:48:37 -07:00
|
|
|
|
2018-02-16 18:04:11 -08:00
|
|
|
@if (($asset->model) && ($asset->model->manufacturer->support_url))
|
2017-12-12 04:31:53 -08:00
|
|
|
<li><i class="fa fa-life-ring"></i> <a href="{{ $asset->model->manufacturer->support_url }}">{{ $asset->model->manufacturer->support_url }}</a></li>
|
|
|
|
@endif
|
2016-10-12 12:48:37 -07:00
|
|
|
|
2018-02-16 18:04:11 -08:00
|
|
|
@if (($asset->model) && ($asset->model->manufacturer->support_phone))
|
2018-01-20 00:20:45 -08:00
|
|
|
<li><i class="fa fa-phone"></i>
|
|
|
|
<a href="tel:{{ $asset->model->manufacturer->support_phone }}">{{ $asset->model->manufacturer->support_phone }}</a>
|
|
|
|
</li>
|
2017-12-12 04:31:53 -08:00
|
|
|
@endif
|
|
|
|
|
2018-02-16 18:04:11 -08:00
|
|
|
@if (($asset->model) && ($asset->model->manufacturer->support_email))
|
2017-12-12 04:31:53 -08:00
|
|
|
<li><i class="fa fa-envelope"></i> <a href="mailto:{{ $asset->model->manufacturer->support_email }}">{{ $asset->model->manufacturer->support_email }}</a></li>
|
|
|
|
@endif
|
|
|
|
</ul>
|
2016-12-27 12:03:47 -08:00
|
|
|
</td>
|
|
|
|
</tr>
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
2018-01-16 16:26:24 -08:00
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{{ trans('general.category') }}</td>
|
|
|
|
<td>
|
2018-02-16 18:04:11 -08:00
|
|
|
@if (($asset->model) && ($asset->model->category))
|
2018-01-16 16:26:24 -08:00
|
|
|
|
|
|
|
@can('view', \App\Models\Category::class)
|
|
|
|
|
|
|
|
<a href="{{ route('categories.show', $asset->model->category->id) }}">
|
|
|
|
{{ $asset->model->category->name }}
|
|
|
|
</a>
|
|
|
|
@else
|
|
|
|
{{ $asset->model->category->name }}
|
|
|
|
@endcan
|
|
|
|
@else
|
|
|
|
Invalid category
|
|
|
|
@endif
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr>
|
|
|
|
<td>
|
2018-02-16 18:04:11 -08:00
|
|
|
{{ trans('admin/hardware/form.model') }}
|
|
|
|
</td>
|
2016-12-27 12:03:47 -08:00
|
|
|
<td>
|
2018-02-16 18:04:11 -08:00
|
|
|
|
|
|
|
@if ($asset->model)
|
|
|
|
|
|
|
|
@can('view', \App\Models\AssetModel::class)
|
|
|
|
<a href="{{ route('models.show', $asset->model->id) }}">
|
|
|
|
{{ $asset->model->name }}
|
|
|
|
</a>
|
|
|
|
@else
|
|
|
|
{{ $asset->model->name }}
|
|
|
|
@endcan
|
|
|
|
|
|
|
|
@endif
|
2016-12-27 12:03:47 -08:00
|
|
|
</td>
|
|
|
|
</tr>
|
2018-01-16 16:26:24 -08:00
|
|
|
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/models/table.modelnumber') }}</td>
|
|
|
|
<td>
|
2018-02-16 18:04:11 -08:00
|
|
|
{{ ($asset->model) ? $asset->model->model_number : ''}}
|
2016-12-27 12:03:47 -08:00
|
|
|
</td>
|
|
|
|
</tr>
|
2017-03-10 22:08:59 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2018-02-16 18:04:11 -08:00
|
|
|
@if (($asset->model) && ($asset->model->fieldset))
|
2016-08-16 18:49:54 -07:00
|
|
|
@foreach($asset->model->fieldset->fields as $field)
|
|
|
|
<tr>
|
2016-12-27 12:03:47 -08:00
|
|
|
<td>
|
|
|
|
{{ $field->name }}
|
2016-08-25 21:03:24 -07:00
|
|
|
</td>
|
2016-08-16 18:49:54 -07:00
|
|
|
<td>
|
2016-12-27 12:03:47 -08:00
|
|
|
@if ($field->field_encrypted=='1')
|
|
|
|
<i class="fa fa-lock" data-toggle="tooltip" data-placement="top" title="{{ trans('admin/custom_fields/general.value_encrypted') }}"></i>
|
|
|
|
@endif
|
2016-08-25 21:03:24 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@if ($field->isFieldDecryptable($asset->{$field->db_column_name()} ))
|
|
|
|
@can('superuser')
|
|
|
|
@if (($field->format=='URL') && ($asset->{$field->db_column_name()}!=''))
|
|
|
|
<a href="{{ \App\Helpers\Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}" target="_new">{{ \App\Helpers\Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}</a>
|
|
|
|
@else
|
|
|
|
{{ \App\Helpers\Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}
|
|
|
|
@endif
|
|
|
|
@else
|
|
|
|
{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}
|
|
|
|
@endcan
|
2016-08-18 12:44:55 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@else
|
|
|
|
@if (($field->format=='URL') && ($asset->{$field->db_column_name()}!=''))
|
|
|
|
<a href="{{ $asset->{$field->db_column_name()} }}" target="_new">{{ $asset->{$field->db_column_name()} }}</a>
|
2016-08-18 12:44:55 -07:00
|
|
|
@else
|
2018-06-21 09:44:10 -07:00
|
|
|
{!! nl2br(e($asset->{$field->db_column_name()})) !!}
|
2016-08-18 12:44:55 -07:00
|
|
|
@endif
|
2016-12-27 12:03:47 -08:00
|
|
|
@endif
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
|
|
|
</tr>
|
2016-03-25 01:18:05 -07:00
|
|
|
@endforeach
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($asset->purchase_date)
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/hardware/form.date') }}</td>
|
|
|
|
<td>
|
2017-03-03 17:29:41 -08:00
|
|
|
{{ \App\Helpers\Helper::getFormattedDateObject($asset->purchase_date, 'date', false) }}
|
2016-12-27 12:03:47 -08:00
|
|
|
</td>
|
2016-03-25 01:18:05 -07:00
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($asset->purchase_cost)
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/hardware/form.cost') }}</td>
|
|
|
|
<td>
|
2017-10-28 02:37:59 -07:00
|
|
|
@if (($asset->id) && ($asset->location))
|
|
|
|
{{ $asset->location->currency }}
|
|
|
|
@elseif (($asset->id) && ($asset->location))
|
|
|
|
{{ $asset->location->currency }}
|
2016-03-25 01:18:05 -07:00
|
|
|
@else
|
Partialize forms (#2884)
* Consolidate edit form elements into reusable partials.
This is a large code change that doesn't do much immediately. It
refactors all of the various edit.blade.php files to reference
standardized partials, so that they all reference the same base html
layout. This has the side effect of moving everything to the new fancy
"required" indicators, and making things look consistent.
In addition, I've gone ahead and renamed a few database fields. We had
Assetmodel::modelno and Consumable::model_no, I've renamed both to
model_number. We had items using ::note and ::notes, I've standardized
on ::notes. Component used total_qty where consumables and accessories
used qty, so I've moved everything to qty (And fixed a few bugs in the
helper file in the process.
TODO includes looking at how/where to place the modal javascripts to
allow for on the fly creation from all places, rather than just the
asset page.
Rename assetmodel::modelno to model_number for clarity and consistency
Rename consumable::model_no to model_number for clarity and consistency
Rename assetmodel::note to notes for clarity and consistency
Port asset and assetmodel to new partials layout. Adapt all code to the renamed model_number and notes database changes. Fix some stying.
* Share a settings variable with all views.
* Allow editing the per_page setting. We showed the value, but we never showed it on the edit page..
* use snipeSettings in all views instead of the long ugly path.
* War on partials. Centralize all bootstrap table javascript
* Use model_number instead of modelno in importer
* Codacy fix.
* More unification/deduplication. Create an edit form template layout that we use as the base for all edit forms. This gives the same interface for editing everything and makes the edit.blade.* files much easier to read.
* Use a ViewComposer instead of sharing the variable directly. Fixes artisan optimize trying to hit the db--which ruins new installs
* Fix DB seeder.
* Base sql dump and csv's to import data from for tests.
* Start some functional tests for creating items.
* Add functional tests for all create methods. Still need to do tests for edits, deletes, and lots of other things
* Improvements to functional tests.
Use the built in DB seeding mechanism instead of doing it ourselves.
Break the tests into multiple units, rather than testing everything in
each function.
* Some improvements to acceptance tests.
Make sure we're only looking at the "trs" within the bootstrap table.
Creation of assets is now tested at the functional level (and is faster)
so ignore it here.
I'm testing acceptance tests with the
IMPORT_{ASSETS,ACCESSORIES,CONSUMABLES}.csv in the tests/_data folder
imported.
* A few things to make acceptance tests work. Add a name to the companies table, and make the locations table have the correct name
* Use a .env.tests file for testing functional and unit to allow a separate database.
* Add functional tests for compoents, groups, and licenses.
* Now that the config is in the functional.yml, this just confuses things.
* Start some functional tests for creating items.
* Add functional tests for all create methods. Still need to do tests for edits, deletes, and lots of other things
* Improvements to functional tests.
Use the built in DB seeding mechanism instead of doing it ourselves.
Break the tests into multiple units, rather than testing everything in
each function.
* Some improvements to acceptance tests.
Make sure we're only looking at the "trs" within the bootstrap table.
Creation of assets is now tested at the functional level (and is faster)
so ignore it here.
I'm testing acceptance tests with the
IMPORT_{ASSETS,ACCESSORIES,CONSUMABLES}.csv in the tests/_data folder
imported.
* update db dump
* Update tests to new reality
* env for the test setup
* only load the database at beginning of tests, not between each Functional test.
* Fix a miss from renaming note to notes.
* Set Termination date when creating an asset. It was only set on edit.
* Rename serial_number to serial in components for consistency.
* Update validation rules to match limits in database. Currently we just accepted the values and they were truncated when adding to DB.
* Much more detailed functional testing of creating items. This checks to make sure all values on form have been successfully persisted to database.
2016-11-16 16:56:57 -08:00
|
|
|
{{ $snipeSettings->default_currency }}
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
2016-08-16 18:47:53 -07:00
|
|
|
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->purchase_cost)}}
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2017-11-30 16:39:59 -08:00
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@if ($asset->order_number)
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('general.order_number') }}</td>
|
|
|
|
<td>
|
|
|
|
#{{ $asset->order_number }}
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
2016-03-25 01:18:05 -07:00
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
|
2016-11-24 12:48:14 -08:00
|
|
|
@if ($asset->supplier)
|
2016-03-25 01:18:05 -07:00
|
|
|
<tr>
|
2016-11-30 23:19:13 -08:00
|
|
|
<td>{{ trans('general.supplier') }}</td>
|
2016-03-25 01:18:05 -07:00
|
|
|
<td>
|
2016-12-27 12:03:47 -08:00
|
|
|
@can ('superuser')
|
|
|
|
<a href="{{ route('suppliers.show', $asset->supplier_id) }}">
|
|
|
|
{{ $asset->supplier->name }}
|
|
|
|
</a>
|
|
|
|
@else
|
|
|
|
{{ $asset->supplier->name }}
|
|
|
|
@endcan
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
2016-03-25 01:18:05 -07:00
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($asset->warranty_months)
|
2016-12-23 17:52:00 -08:00
|
|
|
<tr {!! $asset->present()->warrantee_expires() < date("Y-m-d") ? ' class="warning"' : '' !!}>
|
2016-08-16 18:49:54 -07:00
|
|
|
<td>{{ trans('admin/hardware/form.warranty') }}</td>
|
|
|
|
<td>
|
|
|
|
{{ $asset->warranty_months }}
|
|
|
|
{{ trans('admin/hardware/form.months') }}
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
({{ trans('admin/hardware/form.expires') }}
|
2016-12-23 17:52:00 -08:00
|
|
|
{{ $asset->present()->warrantee_expires() }})
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
|
|
|
</tr>
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
|
|
|
|
2018-02-16 18:04:11 -08:00
|
|
|
@if (($asset->model) && ($asset->depreciation))
|
2016-03-25 01:18:05 -07:00
|
|
|
<tr>
|
2016-12-27 16:24:41 -08:00
|
|
|
<td>{{ trans('general.depreciation') }}</td>
|
2016-03-25 01:18:05 -07:00
|
|
|
<td>
|
2016-12-27 12:03:47 -08:00
|
|
|
{{ $asset->depreciation->name }}
|
|
|
|
({{ $asset->depreciation->months }}
|
|
|
|
{{ trans('admin/hardware/form.months') }}
|
|
|
|
)
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
2016-03-25 01:18:05 -07:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{{ trans('admin/hardware/form.fully_depreciated') }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
@if ($asset->time_until_depreciated()->y > 0)
|
|
|
|
{{ $asset->time_until_depreciated()->y }}
|
|
|
|
{{ trans('admin/hardware/form.years') }},
|
|
|
|
@endif
|
|
|
|
{{ $asset->time_until_depreciated()->m }}
|
|
|
|
{{ trans('admin/hardware/form.months') }}
|
|
|
|
({{ $asset->depreciated_date()->format('Y-m-d') }})
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
2016-03-25 01:18:05 -07:00
|
|
|
</tr>
|
|
|
|
@endif
|
2016-08-16 18:49:54 -07:00
|
|
|
|
2018-02-16 18:04:11 -08:00
|
|
|
@if (($asset->model) && ($asset->model->eol))
|
2016-03-25 01:18:05 -07:00
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/hardware/form.eol_rate') }}</td>
|
|
|
|
<td>
|
|
|
|
{{ $asset->model->eol }}
|
|
|
|
{{ trans('admin/hardware/form.months') }}
|
|
|
|
|
|
|
|
(
|
|
|
|
{{ trans('admin/hardware/form.eol_date') }}:
|
2016-12-23 17:52:00 -08:00
|
|
|
{{ $asset->present()->eol_date() }}
|
|
|
|
@if ($asset->present()->months_until_eol())
|
2016-03-25 01:18:05 -07:00
|
|
|
(
|
2016-12-23 17:52:00 -08:00
|
|
|
@if ($asset->present()->months_until_eol()->y > 0) {{ $asset->present()->months_until_eol()->y }}
|
2016-03-25 01:18:05 -07:00
|
|
|
{{ trans('general.years') }},
|
|
|
|
@endif
|
|
|
|
|
2016-12-23 17:52:00 -08:00
|
|
|
{{ $asset->present()->months_until_eol()->m }}
|
2016-03-25 01:18:05 -07:00
|
|
|
{{ trans('general.months') }}
|
2016-08-16 18:49:54 -07:00
|
|
|
)
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
2016-12-15 13:07:34 -08:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
2016-03-25 01:18:05 -07:00
|
|
|
</tr>
|
|
|
|
@endif
|
2016-08-16 18:49:54 -07:00
|
|
|
|
2016-10-12 12:48:37 -07:00
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
@if ($asset->expected_checkin!='')
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/hardware/form.expected_checkin') }}</td>
|
|
|
|
<td>
|
2017-03-03 17:29:41 -08:00
|
|
|
{{ \App\Helpers\Helper::getFormattedDateObject($asset->expected_checkin, 'date', false) }}
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
2016-03-25 01:18:05 -07:00
|
|
|
</tr>
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
2016-12-27 12:03:47 -08:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
<tr>
|
2016-03-25 01:18:05 -07:00
|
|
|
<td>{{ trans('admin/hardware/form.notes') }}</td>
|
2016-07-27 20:24:09 -07:00
|
|
|
<td> {!! nl2br(e($asset->notes)) !!}</td>
|
2016-03-25 01:18:05 -07:00
|
|
|
</tr>
|
2016-10-12 12:48:37 -07:00
|
|
|
|
2017-10-28 02:37:59 -07:00
|
|
|
@if ($asset->location)
|
2016-06-21 17:19:46 -07:00
|
|
|
<tr>
|
2016-12-27 12:03:47 -08:00
|
|
|
<td>{{ trans('general.location') }}</td>
|
2016-08-16 18:49:54 -07:00
|
|
|
<td>
|
2016-12-27 12:03:47 -08:00
|
|
|
@can('superuser')
|
2017-10-28 02:37:59 -07:00
|
|
|
<a href="{{ route('locations.show', ['location' => $asset->location->id]) }}">
|
|
|
|
{{ $asset->location->name }}
|
2016-12-27 12:03:47 -08:00
|
|
|
</a>
|
|
|
|
@else
|
2017-10-28 02:37:59 -07:00
|
|
|
{{ $asset->location->name }}
|
2016-12-27 12:03:47 -08:00
|
|
|
@endcan
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
2016-06-21 17:19:46 -07:00
|
|
|
</tr>
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
2016-10-12 12:48:37 -07:00
|
|
|
|
2016-10-26 10:12:16 -07:00
|
|
|
@if ($asset->defaultLoc)
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/hardware/form.default_location') }}</td>
|
|
|
|
<td>
|
|
|
|
@can('superuser')
|
|
|
|
<a href="{{ route('locations.show', ['location' => $asset->defaultLoc->id]) }}">
|
|
|
|
{{ $asset->defaultLoc->name }}
|
|
|
|
</a>
|
|
|
|
@else
|
|
|
|
{{ $asset->defaultLoc->name }}
|
|
|
|
@endcan
|
|
|
|
</td>
|
|
|
|
</tr>
|
2016-10-12 12:48:37 -07:00
|
|
|
@endif
|
|
|
|
|
2017-03-03 17:29:41 -08:00
|
|
|
@if ($asset->created_at!='')
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('general.created_at') }}</td>
|
|
|
|
<td>
|
|
|
|
{{ \App\Helpers\Helper::getFormattedDateObject($asset->created_at, 'datetime', false) }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
2016-10-12 12:48:37 -07:00
|
|
|
|
2017-03-03 17:29:41 -08:00
|
|
|
@if ($asset->updated_at!='')
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('general.updated_at') }}</td>
|
|
|
|
<td>
|
|
|
|
{{ \App\Helpers\Helper::getFormattedDateObject($asset->updated_at, 'datetime', false) }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
2018-04-06 16:23:39 -07:00
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('general.checkouts_count') }}</td>
|
|
|
|
<td>
|
|
|
|
{{ ($asset->checkouts) ? (int) $asset->checkouts->count() : '0' }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('general.checkins_count') }}</td>
|
|
|
|
<td>
|
|
|
|
{{ ($asset->checkins) ? (int) $asset->checkins->count() : '0' }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('general.user_requests_count') }}</td>
|
|
|
|
<td>
|
|
|
|
{{ ($asset->userRequests) ? (int) $asset->userRequests->count() : '0' }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
</tbody>
|
2016-08-16 18:49:54 -07:00
|
|
|
</table>
|
|
|
|
</div> <!-- /table-responsive -->
|
2016-12-27 12:03:47 -08:00
|
|
|
</div><!-- /col-md-8 -->
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
<div class="col-md-4">
|
2016-06-21 12:20:22 -07:00
|
|
|
@if ($asset->image)
|
2016-12-15 16:41:36 -08:00
|
|
|
<img src="{{ url('/') }}/uploads/assets/{{{ $asset->image }}}" class="assetimg img-responsive">
|
2018-02-16 18:04:11 -08:00
|
|
|
@elseif (($asset->model) && ($asset->model->image!=''))
|
2016-12-15 16:41:36 -08:00
|
|
|
<img src="{{ url('/') }}/uploads/models/{{{ $asset->model->image }}}" class="assetimg img-responsive">
|
2016-06-21 12:20:22 -07:00
|
|
|
@endif
|
|
|
|
|
2017-09-22 16:12:18 -07:00
|
|
|
@if ($snipeSettings->qr_code=='1')
|
2016-08-23 16:04:22 -07:00
|
|
|
<img src="{{ config('app.url') }}/hardware/{{ $asset->id }}/qr_code" class="img-thumbnail pull-right" style="height: 100px; width: 100px; margin-right: 10px;">
|
2016-06-21 12:20:22 -07:00
|
|
|
@endif
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-12-29 06:56:19 -08:00
|
|
|
@if (($asset->assignedTo) && ($asset->deleted_at==''))
|
2016-03-25 01:18:05 -07:00
|
|
|
<h4>{{ trans('admin/hardware/form.checkedout_to') }}</h4>
|
2016-08-16 18:49:54 -07:00
|
|
|
<p>
|
2017-09-05 17:54:58 -07:00
|
|
|
@if($asset->checkedOutToUser()) <!-- Only users have avatars currently-->
|
|
|
|
<img src="{{ $asset->assignedTo->present()->gravatar() }}" class="user-image-inline" alt="{{ $asset->assignedTo->present()->fullName() }}">
|
2016-12-27 16:24:41 -08:00
|
|
|
@endif
|
2016-12-29 18:12:27 -08:00
|
|
|
{!! $asset->assignedTo->present()->glyph() . ' ' .$asset->assignedTo->present()->nameUrl() !!}
|
2016-08-16 18:49:54 -07:00
|
|
|
</p>
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2017-12-12 04:31:53 -08:00
|
|
|
<ul class="list-unstyled" style="line-height: 25px;">
|
2017-09-05 17:54:58 -07:00
|
|
|
@if ((isset($asset->assignedTo->email)) && ($asset->assignedTo->email!=''))
|
|
|
|
<li><i class="fa fa-envelope-o"></i> <a href="mailto:{{ $asset->assignedTo->email }}">{{ $asset->assignedTo->email }}</a></li>
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2018-01-20 00:20:45 -08:00
|
|
|
@if ((isset($asset->assignedTo)) && ($asset->assignedTo->phone!=''))
|
|
|
|
<li>
|
|
|
|
<i class="fa fa-phone"></i>
|
|
|
|
<a href="tel:{{ $asset->assignedTo->phone }}">{{ $asset->assignedTo->phone }}</a>
|
|
|
|
</li>
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2017-10-28 07:29:32 -07:00
|
|
|
@if (isset($asset->location))
|
|
|
|
<li>{{ $asset->location->name }}</li>
|
|
|
|
<li>{{ $asset->location->address }}
|
|
|
|
@if ($asset->location->address2!='')
|
|
|
|
{{ $asset->location->address2 }}
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
2016-08-16 18:49:54 -07:00
|
|
|
</li>
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2017-10-28 07:29:32 -07:00
|
|
|
<li>{{ $asset->location->city }}
|
|
|
|
@if (($asset->location->city!='') && ($asset->location->state!=''))
|
2016-08-16 18:49:54 -07:00
|
|
|
,
|
|
|
|
@endif
|
2017-10-28 07:29:32 -07:00
|
|
|
{{ $asset->location->state }} {{ $asset->location->zip }}
|
2016-08-16 18:49:54 -07:00
|
|
|
</li>
|
|
|
|
@endif
|
|
|
|
</ul>
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
|
|
|
</div> <!-- div.col-md-4 -->
|
|
|
|
</div><!-- /row -->
|
|
|
|
</div><!-- /.tab-pane asset details -->
|
2016-08-02 17:03:15 -07:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
<div class="tab-pane fade" id="software">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<!-- Licenses assets table -->
|
2018-04-29 06:10:49 -07:00
|
|
|
@if ($asset->licenses->count() > 0)
|
2016-08-16 18:49:54 -07:00
|
|
|
<table class="table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="col-md-4">{{ trans('general.name') }}</th>
|
|
|
|
<th class="col-md-4"><span class="line"></span>{{ trans('admin/licenses/form.license_key') }}</th>
|
|
|
|
<th class="col-md-1"><span class="line"></span>{{ trans('table.actions') }}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach ($asset->licenseseats as $seat)
|
|
|
|
<tr>
|
2016-12-15 18:18:13 -08:00
|
|
|
<td><a href="{{ route('licenses.show', $seat->license->id) }}">{{ $seat->license->name }}</a></td>
|
2018-03-02 18:00:22 -08:00
|
|
|
<td>
|
|
|
|
@can('viewKeys', $seat->license)
|
|
|
|
{!! nl2br(e($seat->license->serial)) !!}
|
|
|
|
@else
|
|
|
|
------------
|
|
|
|
@endcan
|
|
|
|
</td>
|
2016-08-16 18:49:54 -07:00
|
|
|
<td>
|
2017-12-26 16:48:28 -08:00
|
|
|
<a href="{{ route('licenses.checkin', $seat->id) }}" class="btn btn-sm bg-purple" data-tooltip="true">{{ trans('general.checkin') }}</a>
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
@else
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="alert alert-info alert-block">
|
|
|
|
<i class="fa fa-info-circle"></i>
|
|
|
|
{{ trans('general.no_results') }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div><!-- /col -->
|
|
|
|
</div> <!-- row -->
|
|
|
|
</div> <!-- /.tab-pane software -->
|
2016-12-27 12:03:47 -08:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
<div class="tab-pane fade" id="components">
|
|
|
|
<!-- checked out assets table -->
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
2018-04-29 06:10:49 -07:00
|
|
|
@if($asset->components->count() > 0)
|
2016-08-16 18:49:54 -07:00
|
|
|
<table class="table table-striped">
|
2018-01-24 05:25:01 -08:00
|
|
|
<thead>
|
|
|
|
<th>{{ trans('general.name') }}</th>
|
|
|
|
<th>{{ trans('general.qty') }}</th>
|
|
|
|
<th>{{ trans('general.purchase_cost') }}</th>
|
|
|
|
</thead>
|
2016-08-16 18:49:54 -07:00
|
|
|
<tbody>
|
|
|
|
<?php $totalCost = 0; ?>
|
|
|
|
@foreach ($asset->components as $component)
|
2018-06-02 06:21:51 -07:00
|
|
|
|
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
@if (is_null($component->deleted_at))
|
2016-05-18 19:26:50 -07:00
|
|
|
<tr>
|
2018-01-24 05:25:01 -08:00
|
|
|
<td>
|
|
|
|
<a href="{{ route('components.show', $component->id) }}">{{ $component->name }}</a>
|
|
|
|
</td>
|
|
|
|
<td>{{ $component->pivot->assigned_qty }}</td>
|
|
|
|
<td>{{ $component->purchase_cost }}</td>
|
2018-06-02 06:21:51 -07:00
|
|
|
<?php $totalCost = $totalCost + $component->purchase_cost ;?>
|
2018-01-24 05:25:01 -08:00
|
|
|
|
2016-05-18 19:26:50 -07:00
|
|
|
</tr>
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
2018-06-02 06:21:51 -07:00
|
|
|
<td colspan="2">
|
|
|
|
</td>
|
|
|
|
<td>{{ $totalCost }}</td>
|
2016-08-16 18:49:54 -07:00
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
</table>
|
|
|
|
@else
|
|
|
|
<div class="alert alert-info alert-block">
|
|
|
|
<i class="fa fa-info-circle"></i>
|
|
|
|
{{ trans('general.no_results') }}
|
|
|
|
</div>
|
|
|
|
@endif
|
2016-05-18 19:26:50 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-08-16 18:49:54 -07:00
|
|
|
</div> <!-- /.tab-pane components -->
|
2016-12-27 12:03:47 -08:00
|
|
|
|
2018-01-10 05:44:11 -08:00
|
|
|
|
|
|
|
<div class="tab-pane fade" id="assets">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
{{ Form::open([
|
|
|
|
'method' => 'POST',
|
|
|
|
'route' => ['hardware/bulkedit'],
|
|
|
|
'class' => 'form-inline',
|
|
|
|
'id' => 'bulkForm']) }}
|
|
|
|
<div id="toolbar">
|
2018-02-16 13:22:55 -08:00
|
|
|
<select name="bulk_actions" class="form-control select2" style="width: 150px;">
|
2018-01-10 05:44:11 -08:00
|
|
|
<option value="edit">Edit</option>
|
|
|
|
<option value="delete">Delete</option>
|
|
|
|
<option value="labels">Generate Labels</option>
|
|
|
|
</select>
|
|
|
|
<button class="btn btn-primary" id="bulkEdit" disabled>Go</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- checked out assets table -->
|
|
|
|
<div class="table-responsive">
|
2018-02-16 13:22:55 -08:00
|
|
|
|
2018-01-10 05:44:11 -08:00
|
|
|
<table
|
2018-02-23 05:53:00 -08:00
|
|
|
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
|
|
|
data-cookie-id-table="assetsTable"
|
|
|
|
data-pagination="true"
|
|
|
|
data-id-table="assetsTable"
|
|
|
|
data-search="true"
|
|
|
|
data-side-pagination="server"
|
|
|
|
data-show-columns="true"
|
2018-02-16 13:22:55 -08:00
|
|
|
data-show-export="true"
|
|
|
|
data-show-refresh="true"
|
2018-02-23 05:53:00 -08:00
|
|
|
data-sort-order="asc"
|
|
|
|
id="assetsListingTable"
|
|
|
|
class="table table-striped snipe-table"
|
2018-01-10 05:44:11 -08:00
|
|
|
data-url="{{route('api.assets.index',['assigned_to' => $asset->id, 'assigned_type' => 'App\Models\Asset']) }}"
|
2018-02-23 05:53:00 -08:00
|
|
|
data-export-options='{
|
|
|
|
"fileName": "export-assets-{{ str_slug($asset->name) }}-assets-{{ date('Y-m-d') }}",
|
|
|
|
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
|
|
|
}'>
|
|
|
|
|
2018-01-10 05:44:11 -08:00
|
|
|
</table>
|
2018-02-16 13:22:55 -08:00
|
|
|
|
|
|
|
|
2018-01-10 05:44:11 -08:00
|
|
|
{{ Form::close() }}
|
|
|
|
</div>
|
|
|
|
</div><!-- /col -->
|
|
|
|
</div> <!-- row -->
|
|
|
|
</div> <!-- /.tab-pane software -->
|
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
<div class="tab-pane fade" id="maintenances">
|
|
|
|
<div class="row">
|
2016-08-16 18:49:54 -07:00
|
|
|
<div class="col-md-12">
|
2016-12-19 11:04:28 -08:00
|
|
|
@can('update', \App\Models\Asset::class)
|
2018-02-16 13:22:55 -08:00
|
|
|
<div id="maintenance-toolbar">
|
|
|
|
<a href="{{ route('maintenances.create', ['asset_id' => $asset->id]) }}" class="btn btn-primary">Add Maintenance</a>
|
|
|
|
</div>
|
2016-11-29 13:37:45 -08:00
|
|
|
@endcan
|
2016-08-16 18:49:54 -07:00
|
|
|
|
|
|
|
<!-- Asset Maintenance table -->
|
2018-02-16 13:22:55 -08:00
|
|
|
<table
|
2018-03-26 14:49:49 -07:00
|
|
|
data-columns="{{ \App\Presenters\AssetMaintenancesPresenter::dataTableLayout() }}"
|
2018-02-16 13:22:55 -08:00
|
|
|
class="table table-striped snipe-table"
|
|
|
|
id="assetMaintenancesTable"
|
|
|
|
data-pagination="true"
|
|
|
|
data-id-table="assetMaintenancesTable"
|
|
|
|
data-search="true"
|
|
|
|
data-side-pagination="server"
|
|
|
|
data-toolbar="#maintenance-toolbar"
|
|
|
|
data-show-columns="true"
|
|
|
|
data-show-refresh="true"
|
|
|
|
data-show-export="true"
|
|
|
|
data-export-options='{
|
|
|
|
"fileName": "export-{{ $asset->asset_tag }}-maintenances",
|
|
|
|
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
|
|
|
}'
|
|
|
|
data-url="{{ route('api.maintenances.index', array('asset_id' => $asset->id)) }}"
|
|
|
|
data-cookie-id-table="assetMaintenancesTable">
|
2016-12-27 12:03:47 -08:00
|
|
|
</table>
|
2016-08-16 18:49:54 -07:00
|
|
|
</div> <!-- /.col-md-12 -->
|
|
|
|
</div> <!-- /.row -->
|
|
|
|
</div> <!-- /.tab-pane maintenances -->
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
<div class="tab-pane fade" id="history">
|
|
|
|
<!-- checked out assets table -->
|
|
|
|
<div class="row">
|
2016-08-16 18:49:54 -07:00
|
|
|
<div class="col-md-12">
|
2017-06-08 18:26:55 -07:00
|
|
|
<table
|
|
|
|
class="table table-striped snipe-table"
|
2018-02-16 13:22:55 -08:00
|
|
|
id="assetHistory"
|
|
|
|
data-pagination="true"
|
|
|
|
data-id-table="assetHistory"
|
2017-12-12 05:10:13 -08:00
|
|
|
data-search="true"
|
2018-02-16 13:22:55 -08:00
|
|
|
data-side-pagination="server"
|
|
|
|
data-show-columns="true"
|
2017-12-12 05:10:13 -08:00
|
|
|
data-show-refresh="true"
|
2018-04-24 02:54:54 -07:00
|
|
|
data-sort-order="desc"
|
|
|
|
data-sort-name="created_at"
|
2018-02-16 13:22:55 -08:00
|
|
|
data-show-export="true"
|
|
|
|
data-export-options='{
|
2018-05-02 14:13:06 -07:00
|
|
|
"fileName": "export-asset-{{ $asset->id }}-history",
|
2018-02-16 13:22:55 -08:00
|
|
|
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
|
|
|
}'
|
|
|
|
|
|
|
|
data-url="{{ route('api.activity.index', ['item_id' => $asset->id, 'item_type' => 'asset']) }}"
|
|
|
|
data-cookie-id-table="assetHistory">
|
2016-08-16 18:49:54 -07:00
|
|
|
<thead>
|
2017-06-08 18:26:55 -07:00
|
|
|
<tr>
|
2018-05-02 14:13:06 -07:00
|
|
|
<th data-field="icon" data-visible="true" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter"></th>
|
|
|
|
<th class="col-sm-2" data-visible="true" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
|
|
|
|
<th class="col-sm-1" data-visible="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
|
|
|
|
<th class="col-sm-1" data-visible="true" data-field="action_type">{{ trans('general.action') }}</th>
|
|
|
|
<th class="col-sm-2" data-visible="true" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
|
|
|
|
<th class="col-sm-2" data-visible="true" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
|
2017-06-08 18:26:55 -07:00
|
|
|
<th class="col-sm-2" data-field="note">{{ trans('general.notes') }}</th>
|
2017-09-27 12:58:08 -07:00
|
|
|
@if ($snipeSettings->require_accept_signature=='1')
|
2017-12-12 04:59:28 -08:00
|
|
|
<th class="col-md-3" data-field="signature_file" data-visible="false" data-formatter="imageFormatter">{{ trans('general.signature') }}</th>
|
2017-09-27 12:58:08 -07:00
|
|
|
@endif
|
2018-05-02 14:13:06 -07:00
|
|
|
<th class="col-md-3" data-visible="false" data-field="file" data-visible="false" data-formatter="fileUploadFormatter">{{ trans('general.download') }}</th>
|
2018-01-10 01:56:24 -08:00
|
|
|
<th class="col-sm-2" data-field="log_meta" data-visible="true" data-formatter="changeLogFormatter">Changed</th>
|
2017-06-08 18:26:55 -07:00
|
|
|
</tr>
|
2016-08-16 18:49:54 -07:00
|
|
|
</thead>
|
|
|
|
</table>
|
2017-12-12 04:59:28 -08:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
</div>
|
|
|
|
</div> <!-- /.row -->
|
|
|
|
</div> <!-- /.tab-pane history -->
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
<div class="tab-pane fade" id="files">
|
|
|
|
<div class="row">
|
2016-08-16 18:49:54 -07:00
|
|
|
<div class="col-md-12">
|
2018-05-02 14:13:06 -07:00
|
|
|
<table
|
|
|
|
class="table table-striped snipe-table"
|
|
|
|
id="assetFileHistory"
|
|
|
|
data-pagination="true"
|
|
|
|
data-id-table="assetFileHistory"
|
|
|
|
data-search="true"
|
|
|
|
data-side-pagination="client"
|
|
|
|
data-show-columns="true"
|
|
|
|
data-show-refresh="true"
|
|
|
|
data-sort-order="desc"
|
|
|
|
data-sort-name="created_at"
|
|
|
|
data-show-export="true"
|
|
|
|
data-export-options='{
|
|
|
|
"fileName": "export-asset-{{ $asset->id }}-files",
|
|
|
|
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
|
|
|
}'
|
|
|
|
data-cookie-id-table="assetFileHistory">
|
2016-03-25 01:18:05 -07:00
|
|
|
<thead>
|
2016-08-16 18:49:54 -07:00
|
|
|
<tr>
|
2018-05-29 16:38:23 -07:00
|
|
|
<th data-visible="true" data-field="icon"></th>
|
|
|
|
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="notes">{{ trans('general.notes') }}</th>
|
|
|
|
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">{{ trans('general.image') }}</th>
|
|
|
|
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename">{{ trans('general.file_name') }}</th>
|
|
|
|
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="download">{{ trans('general.download') }}</th>
|
|
|
|
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_at">{{ trans('general.created_at') }}</th>
|
|
|
|
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="actions">{{ trans('table.actions') }}</th>
|
2016-08-16 18:49:54 -07:00
|
|
|
</tr>
|
2016-03-25 01:18:05 -07:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2018-04-29 06:10:49 -07:00
|
|
|
@if ($asset->uploads->count() > 0)
|
2016-08-16 18:49:54 -07:00
|
|
|
@foreach ($asset->uploads as $file)
|
|
|
|
<tr>
|
2018-05-02 14:13:06 -07:00
|
|
|
<td><i class="{{ \App\Helpers\Helper::filetype_icon($file->filename) }} icon-med"></i></td>
|
2016-08-16 18:49:54 -07:00
|
|
|
<td>
|
|
|
|
@if ($file->note)
|
2016-12-27 12:03:47 -08:00
|
|
|
{{ $file->note }}
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
@if ( \App\Helpers\Helper::checkUploadIsImage($file->get_src('assets')))
|
2018-05-29 16:38:23 -07:00
|
|
|
<a href="{{ route('show/assetfile', ['assetId' => $asset->id, 'fileId' =>$file->id]) }}" data-toggle="lightbox" data-type="image" data-title="{{ $file->filename }}" data-footer="{{ \App\Helpers\Helper::getFormattedDateObject($asset->last_checkout, 'datetime', false) }}">
|
|
|
|
<img src="{{ route('show/assetfile', ['assetId' => $asset->id, 'fileId' =>$file->id]) }}" style="max-width: 50px;">
|
|
|
|
</a>
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ $file->filename }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
@if ($file->filename)
|
2018-05-02 14:13:06 -07:00
|
|
|
<a href="{{ route('show/assetfile', [$asset->id, $file->id]) }}" class="btn btn-default"><i class="fa fa-download"></i></a>
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
|
|
|
</td>
|
2018-05-29 16:38:23 -07:00
|
|
|
|
|
|
|
<td>
|
|
|
|
@if ($file->created_at)
|
2018-08-01 02:43:08 -07:00
|
|
|
{{ \App\Helpers\Helper::getFormattedDateObject($file->created_at, 'datetime', false) }}
|
2018-05-29 16:38:23 -07:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
<td>
|
2016-12-27 12:03:47 -08:00
|
|
|
@can('update', \App\Models\Asset::class)
|
2018-07-16 17:44:03 -07:00
|
|
|
<a class="btn delete-asset btn-sm btn-danger btn-sm" href="{{ route('delete/assetfile', [$asset->id, $file->id]) }}" data-tooltip="true" data-title="Delete" data-content="{{ trans('general.delete_confirm', ['item' => $file->filename]) }}"><i class="fa fa-trash icon-white"></i></a>
|
2016-12-27 12:03:47 -08:00
|
|
|
@endcan
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
2018-07-25 07:40:04 -07:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
2016-03-25 01:18:05 -07:00
|
|
|
</tbody>
|
2016-08-16 18:49:54 -07:00
|
|
|
</table>
|
|
|
|
</div> <!-- /.col-md-12 -->
|
|
|
|
</div> <!-- /.row -->
|
|
|
|
</div> <!-- /.tab-pane files -->
|
|
|
|
</div> <!-- /. tab-content -->
|
|
|
|
</div> <!-- /.nav-tabs-custom -->
|
|
|
|
</div> <!-- /. col-md-12 -->
|
|
|
|
</div> <!-- /. row -->
|
2018-07-16 20:09:53 -07:00
|
|
|
|
|
|
|
@can('update', \App\Models\Asset::class)
|
|
|
|
@include ('modals.upload-file', ['item_type' => 'asset', 'item_id' => $asset->id])
|
|
|
|
@endcan
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@stop
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
@section('moar_scripts')
|
2018-01-10 05:44:11 -08:00
|
|
|
@include ('partials.bootstrap-table')
|
2017-06-08 18:26:55 -07:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
@stop
|