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')
|
2016-12-27 12:03:47 -08:00
|
|
|
@can('manage', \App\Models\Asset::class)
|
|
|
|
<div class="dropdown pull-right">
|
|
|
|
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
|
|
|
|
<span class="caret"></span>
|
|
|
|
</button>
|
|
|
|
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1">
|
|
|
|
@if ($asset->assetstatus->deployable=='1')
|
|
|
|
@if ($asset->assigned_to != '')
|
|
|
|
<li role="presentation"><a href="{{ route('checkin/hardware', $asset->id) }}">{{ trans('admin/hardware/general.checkin') }}</a></li>
|
|
|
|
@else
|
|
|
|
<li role="presentation"><a href="{{ route('checkout/hardware', $asset->id) }}">{{ trans('admin/hardware/general.checkout') }}</a></li>
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
<li role="presentation"><a href="{{ route('hardware.edit', $asset->id) }}">{{ trans('admin/hardware/general.edit') }}</a></li>
|
|
|
|
<li role="presentation"><a href="{{ route('clone/hardware', $asset->id) }}">{{ trans('admin/hardware/general.clone') }}</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
@endcan
|
2016-03-25 01:18:05 -07:00
|
|
|
@stop
|
|
|
|
|
|
|
|
{{-- Page content --}}
|
|
|
|
@section('content')
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
|
|
|
<!-- Custom Tabs -->
|
|
|
|
<div class="nav-tabs-custom">
|
|
|
|
<ul class="nav nav-tabs">
|
|
|
|
<li class="active">
|
2016-04-07 02:51:57 -07: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">Details</span></a>
|
2016-03-25 01:18:05 -07:00
|
|
|
</li>
|
|
|
|
<li>
|
2016-04-07 02:51:57 -07: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">Licenses</span></a>
|
2016-03-25 01:18:05 -07:00
|
|
|
</li>
|
2016-08-16 18:49:54 -07:00
|
|
|
<li>
|
|
|
|
<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">Components</span></a>
|
|
|
|
</li>
|
2016-03-25 01:18:05 -07:00
|
|
|
<li>
|
2016-04-07 02:51:57 -07: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">Maintenances</span></a>
|
2016-03-25 01:18:05 -07:00
|
|
|
</li>
|
|
|
|
<li>
|
2016-04-07 02:51:57 -07: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">History</span></a>
|
2016-03-25 01:18:05 -07:00
|
|
|
</li>
|
|
|
|
<li>
|
2016-04-07 02:51:57 -07: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">Files</span></a>
|
2016-03-25 01:18:05 -07:00
|
|
|
</li>
|
2016-04-07 02:51:57 -07:00
|
|
|
<li class="pull-right">
|
2016-11-29 13:37:45 -08:00
|
|
|
<!-- <a href="#" data-toggle="modal" data-target="#uploadFileModal"><i class="fa fa-paperclip"></i> </a> -->
|
2016-08-16 18:49:54 -07:00
|
|
|
</li>
|
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>
|
|
|
|
@if ($asset->assetstatus->color)
|
|
|
|
<span class="label label-default" style="background-color: {{ e($asset->assetstatus->color) }};">
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
@endif
|
2017-01-03 16:55:43 -08:00
|
|
|
{{ $asset->present()->statusText() }}
|
2016-12-27 12:03:47 -08:00
|
|
|
({{ $asset->assetstatus->getStatuslabelType() }})
|
|
|
|
</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
|
2016-10-12 12:48:37 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@if ($asset->model->manufacturer)
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/hardware/form.manufacturer') }}</td>
|
|
|
|
<td>
|
2017-03-10 22:08:59 -08:00
|
|
|
@can('view', \App\Models\Manufacturer::class)
|
2016-12-27 12:03:47 -08:00
|
|
|
<a href="{{ route('manufacturers.show', $asset->model->manufacturer->id) }}">
|
|
|
|
{{ $asset->model->manufacturer->name }}
|
|
|
|
</a>
|
|
|
|
@else
|
|
|
|
{{ $asset->model->manufacturer->name }}
|
|
|
|
@endcan
|
2017-03-10 22:08:59 -08:00
|
|
|
|
|
|
|
@if ($asset->model->manufacturer->url)
|
|
|
|
<br><i class="fa fa-globe"></i> <a href="{{ $asset->model->manufacturer->url }}">{{ $asset->model->manufacturer->url }}</a>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($asset->model->manufacturer->support_url)
|
|
|
|
<br><i class="fa fa-life-ring"></i> <a href="{{ $asset->model->manufacturer->support_url }}">{{ $asset->model->manufacturer->support_url }}</a>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($asset->model->manufacturer->support_phone)
|
|
|
|
<br><i class="fa fa-phone"></i> {{ $asset->model->manufacturer->support_phone }}
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($asset->model->manufacturer->support_email)
|
|
|
|
<br><i class="fa fa-envelope"></i> <a href="mailto:{{ $asset->model->manufacturer->support_email }}">{{ $asset->model->manufacturer->support_email }}</a>
|
|
|
|
@endif
|
2016-12-27 12:03:47 -08:00
|
|
|
</td>
|
|
|
|
</tr>
|
2017-03-10 22:08:59 -08:00
|
|
|
@endif
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{{ trans('admin/hardware/form.model') }}</td>
|
|
|
|
<td>
|
2017-03-10 22:08:59 -08:00
|
|
|
@can('view', \App\Models\AssetModel::class)
|
2016-12-27 12:03:47 -08:00
|
|
|
<a href="{{ route('models.show', $asset->model->id) }}">
|
|
|
|
{{ $asset->model->name }}
|
|
|
|
</a>
|
|
|
|
@else
|
|
|
|
{{ $asset->model->name }}
|
|
|
|
@endcan
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('admin/models/table.modelnumber') }}</td>
|
|
|
|
<td>
|
|
|
|
{{ $asset->model->model_number }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
2017-03-10 22:08:59 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
@if ($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
|
2016-12-27 12:03:47 -08:00
|
|
|
{{ $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>
|
|
|
|
@if (($asset->id) && ($asset->userloc))
|
|
|
|
{{ $asset->userloc->currency }}
|
|
|
|
@elseif (($asset->id) && ($asset->assetloc))
|
|
|
|
{{ $asset->assetloc->currency }}
|
|
|
|
@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
|
|
|
|
|
|
|
@if ($asset->order_number)
|
2016-12-27 12:03:47 -08:00
|
|
|
(Order #{{ $asset->order_number }})
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
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
|
|
|
|
|
|
|
|
@if ($asset->depreciation)
|
|
|
|
<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
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
@if ($asset->model->eol)
|
|
|
|
<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
|
|
|
|
|
|
|
@if ($asset->assetloc)
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr>
|
|
|
|
<td>{{ trans('general.location') }}</td>
|
|
|
|
<td>
|
|
|
|
@can('superuser')
|
|
|
|
<a href="{{ route('locations.show', ['location' => $asset->assetloc->id]) }}">
|
|
|
|
{{ $asset->assetloc->name }}
|
|
|
|
</a>
|
|
|
|
@else
|
|
|
|
{{ $asset->assetloc->name }}
|
|
|
|
@endcan
|
|
|
|
</td>
|
|
|
|
</tr>
|
2016-10-12 12:48:37 -07:00
|
|
|
@endif
|
|
|
|
|
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
|
|
|
|
|
|
|
|
@if ($asset->updated_at!='')
|
|
|
|
<tr>
|
|
|
|
<td>{{ trans('general.updated_at') }}</td>
|
|
|
|
<td>
|
|
|
|
{{ \App\Helpers\Helper::getFormattedDateObject($asset->updated_at, 'datetime', false) }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
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">
|
2016-08-16 18:49:54 -07:00
|
|
|
@elseif ($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
|
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@if ($snipeSettings->qr_code=='1')
|
2016-12-15 16:41:36 -08:00
|
|
|
<img src="{{ 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>
|
2016-12-27 16:24:41 -08:00
|
|
|
@if($asset->assigned_type == User::class) <!-- Only users have avatars currently-->
|
|
|
|
<img src="{{ $asset->assignedTo->present()->gravatar() }}" class="user-image-inline" alt="{{ $asset->assigneduser->present()->fullName() }}">
|
|
|
|
@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
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
<ul class="list-unstyled">
|
|
|
|
@if ((isset($asset->assigneduser->email)) && ($asset->assigneduser->email!=''))
|
|
|
|
<li><i class="fa fa-envelope-o"></i> <a href="mailto:{{ $asset->assigneduser->email }}">{{ $asset->assigneduser->email }}</a></li>
|
|
|
|
@endif
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
@if ((isset($asset->assigneduser->phone)) && ($asset->assigneduser->phone!=''))
|
|
|
|
<li><i class="fa fa-phone"></i> {{ $asset->assigneduser->phone }}</li>
|
|
|
|
@endif
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-12-29 06:56:19 -08:00
|
|
|
@if (isset($asset->assetLoc))
|
|
|
|
<li>{{ $asset->assetLoc->name }}</li>
|
|
|
|
<li>{{ $asset->assetLoc->address }}
|
|
|
|
@if ($asset->assetLoc->address2!='')
|
|
|
|
{{ $asset->assetLoc->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
|
|
|
|
2016-12-29 06:56:19 -08:00
|
|
|
<li>{{ $asset->assetLoc->city }}
|
|
|
|
@if (($asset->assetLoc->city!='') && ($asset->assetLoc->state!=''))
|
2016-08-16 18:49:54 -07:00
|
|
|
,
|
|
|
|
@endif
|
2016-12-29 06:56:19 -08:00
|
|
|
{{ $asset->assetLoc->state }} {{ $asset->assetLoc->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 -->
|
|
|
|
@if (count($asset->licenses) > 0)
|
|
|
|
<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>
|
2016-08-16 18:49:54 -07:00
|
|
|
<td>{{ $seat->license->serial }}</td>
|
|
|
|
<td>
|
2016-12-15 13:07:34 -08:00
|
|
|
<a href="{{ route('licenses.checkin', $seat->id) }}" class="btn-flat info btn-sm">{{ 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">
|
|
|
|
@if(count($asset->components) > 0)
|
|
|
|
<table class="table table-striped">
|
|
|
|
<tbody>
|
|
|
|
<?php $totalCost = 0; ?>
|
|
|
|
@foreach ($asset->components as $component)
|
|
|
|
@if (is_null($component->deleted_at))
|
2016-05-18 19:26:50 -07:00
|
|
|
<tr>
|
2016-12-15 19:59:42 -08:00
|
|
|
<td><a href="{{ route('components.show', $component->id) }}">{{ $component->name }}</a></td>
|
2016-05-18 19:26:50 -07:00
|
|
|
</tr>
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
|
|
<td colspan="7" class="text-right">{{ $use_currency.$totalCost }}</td>
|
|
|
|
</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
|
|
|
|
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)
|
|
|
|
<h6>{{ trans('general.asset_maintenances') }}
|
2016-12-26 15:17:12 -08:00
|
|
|
[ <a href="{{ route('maintenances.create', ['asset_id'=>$asset->id]) }}">{{ trans('button.add') }}</a> ]
|
2016-12-19 11:04:28 -08:00
|
|
|
</h6>
|
2016-11-29 13:37:45 -08:00
|
|
|
@endcan
|
2016-08-16 18:49:54 -07:00
|
|
|
|
|
|
|
<!-- Asset Maintenance table -->
|
|
|
|
@if (count($asset->assetmaintenances) > 0)
|
2016-12-27 12:03:47 -08:00
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans('general.supplier') }}</th>
|
|
|
|
<th>{{ trans('admin/asset_maintenances/form.title') }}</th>
|
|
|
|
<th>{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}</th>
|
|
|
|
<th>{{ trans('admin/asset_maintenances/form.start_date') }}</th>
|
|
|
|
<th>{{ trans('admin/asset_maintenances/form.completion_date') }}</th>
|
|
|
|
<th>{{ trans('admin/asset_maintenances/form.notes') }}</th>
|
|
|
|
<th>{{ trans('admin/asset_maintenances/table.is_warranty') }}</th>
|
|
|
|
<th>{{ trans('admin/asset_maintenances/form.cost') }}</th>
|
|
|
|
<th>{{ trans('general.admin') }}</th>
|
|
|
|
|
|
|
|
@can('update', \App\Models\Asset::class)
|
|
|
|
<th>{{ trans('table.actions') }}</th>
|
|
|
|
@endcan
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php $totalCost = 0; ?>
|
2016-06-22 17:04:47 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
@foreach ($asset->assetmaintenances as $assetMaintenance)
|
|
|
|
@if (is_null($assetMaintenance->deleted_at))
|
|
|
|
<tr>
|
|
|
|
<td><a href="{{ route('suppliers.show', $assetMaintenance->supplier_id) }}">{{ $assetMaintenance->supplier->name }}</a></td>
|
|
|
|
<td>{{ $assetMaintenance->title }}</td>
|
|
|
|
<td>{{ $assetMaintenance->asset_maintenance_type }}</td>
|
|
|
|
<td>{{ $assetMaintenance->start_date }}</td>
|
|
|
|
<td>{{ $assetMaintenance->completion_date }}</td>
|
|
|
|
<td>{{ $assetMaintenance->notes }}</td>
|
|
|
|
<td>{{ $assetMaintenance->is_warranty ? trans('admin/asset_maintenances/message.warranty') : trans('admin/asset_maintenances/message.not_warranty') }}</td>
|
|
|
|
<td class="text-right"><nobr>{{ $use_currency.$assetMaintenance->cost }}</nobr></td>
|
|
|
|
<td>
|
|
|
|
@if ($assetMaintenance->admin)
|
|
|
|
<a href="{{ route('users.show', $assetMaintenance->admin->id) }}">{{ $assetMaintenance->admin->present()->fullName() }}</a>
|
|
|
|
@endif
|
|
|
|
</td>
|
2016-12-29 14:02:18 -08:00
|
|
|
<?php $totalCost += $assetMaintenance->cost; ?>
|
2016-12-27 12:03:47 -08:00
|
|
|
@can('update', \App\Models\Asset::class)
|
|
|
|
<td>
|
|
|
|
<a href="{{ route('maintenances.edit', $assetMaintenance->id) }}" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a>
|
|
|
|
</td>
|
|
|
|
@endcan
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
|
|
<td colspan="8" class="text-right">{{ is_numeric($totalCost) ? $use_currency.number_format($totalCost, 2) : $totalCost }}</td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
</table>
|
2016-08-16 18:49:54 -07:00
|
|
|
@else
|
|
|
|
<div class="alert alert-info alert-block">
|
2016-03-25 01:18:05 -07:00
|
|
|
<i class="fa fa-info-circle"></i>
|
|
|
|
{{ trans('general.no_results') }}
|
2016-08-16 18:49:54 -07:00
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</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">
|
|
|
|
<table class="table table-hover table-fixed break-word">
|
|
|
|
<thead>
|
2016-03-25 01:18:05 -07:00
|
|
|
<tr>
|
|
|
|
<th class="col-md-3">{{ trans('general.date') }}</th>
|
|
|
|
<th class="col-md-2"><span class="line"></span>{{ trans('general.admin') }}</th>
|
|
|
|
<th class="col-md-2"><span class="line"></span>{{ trans('table.actions') }}</th>
|
|
|
|
<th class="col-md-2"><span class="line"></span>{{ trans('general.user') }}</th>
|
|
|
|
<th class="col-md-3"><span class="line"></span>{{ trans('general.notes') }}</th>
|
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
|
|
|
@if ($snipeSettings->require_accept_signature=='1')
|
2016-10-31 21:00:30 -07:00
|
|
|
<th class="col-md-3"><span class="line"></span>{{ trans('general.signature') }}</th>
|
|
|
|
@endif
|
2016-03-25 01:18:05 -07:00
|
|
|
</tr>
|
2016-08-16 18:49:54 -07:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@if (count($asset->assetlog) > 0)
|
|
|
|
@foreach ($asset->assetlog as $log)
|
2016-12-29 22:23:36 -08:00
|
|
|
@php $result = $log->present()->forDataTable();
|
|
|
|
@endphp
|
2016-08-16 18:49:54 -07:00
|
|
|
<tr>
|
2016-12-29 22:23:36 -08:00
|
|
|
<td>{{ $result['created_at'] }}</td>
|
|
|
|
<td> {!! $result['admin'] !!} </td>
|
|
|
|
<td>{{ $result['action_type'] }}</td>
|
|
|
|
<td>{!! $result['target'] !!} </td>
|
2016-08-16 18:49:54 -07:00
|
|
|
<td>
|
2016-12-29 22:23:36 -08:00
|
|
|
{{ $result['note'] }}
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
2016-12-27 12:03:47 -08:00
|
|
|
@if ($snipeSettings->require_accept_signature=='1')
|
|
|
|
<td>
|
|
|
|
@if (($log->accept_signature!='') && (($log->action_type=='accepted') || ($log->action_type=='declined')))
|
|
|
|
<a href="{{ route('log.signature.view', ['filename' => $log->accept_signature ]) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('log.signature.view', ['filename' => $log->accept_signature ]) }}" class="img-responsive"></a>
|
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
@endif
|
2016-08-16 18:49:54 -07:00
|
|
|
</tr>
|
|
|
|
@endforeach
|
2016-03-25 01:18:05 -07:00
|
|
|
@endif
|
2016-08-16 18:49:54 -07:00
|
|
|
<!-- Add a "created asset" row to the log list. This isn't an official log entry.-->
|
2016-03-25 01:18:05 -07:00
|
|
|
<tr>
|
2016-08-16 18:49:54 -07:00
|
|
|
<td>{{ $asset->created_at }}</td>
|
|
|
|
<td>
|
2016-12-27 12:03:47 -08:00
|
|
|
@if ($asset->adminuser)
|
|
|
|
{{ $asset->adminuser->present()->fullName() }}
|
|
|
|
@else
|
|
|
|
{{ trans('general.unknown_admin') }}
|
|
|
|
@endif
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
|
|
|
<td>{{ trans('general.created_asset') }}</td>
|
|
|
|
<td></td> <!-- User -->
|
|
|
|
<td></td> <!-- Notes -->
|
2016-03-25 01:18:05 -07:00
|
|
|
</tr>
|
2016-08-16 18:49:54 -07:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</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-12-19 11:04:28 -08:00
|
|
|
@can('update', \App\Models\Asset::class)
|
2016-12-27 12:03:47 -08:00
|
|
|
{{ Form::open([
|
|
|
|
'method' => 'POST',
|
|
|
|
'route' => ['upload/asset', $asset->id],
|
|
|
|
'files' => true, 'class' => 'form-horizontal' ]) }}
|
|
|
|
|
|
|
|
<div class="col-md-2">
|
|
|
|
<span class="btn btn-default btn-file">Browse for file...
|
|
|
|
{{ Form::file('assetfile[]', ['multiple' => 'multiple']) }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-7">
|
|
|
|
{{ Form::text('notes', Input::old('notes', Input::old('notes')), array('class' => 'form-control','placeholder' => 'Notes')) }}
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
<button type="submit" class="btn btn-primary">{{ trans('button.upload') }}</button>
|
|
|
|
</div>
|
2016-05-19 23:12:27 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
<div class="col-md-12">
|
|
|
|
<p>{{ trans('admin/hardware/general.filetype_info') }}</p>
|
|
|
|
<hr>
|
|
|
|
</div>
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-12-27 12:03:47 -08:00
|
|
|
{{ Form::close() }}
|
2016-12-19 11:04:28 -08:00
|
|
|
@endcan
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-08-16 18:49:54 -07:00
|
|
|
<div class="col-md-12">
|
|
|
|
<table class="table table-hover">
|
2016-03-25 01:18:05 -07:00
|
|
|
<thead>
|
2016-08-16 18:49:54 -07:00
|
|
|
<tr>
|
|
|
|
<th class="col-md-4">{{ trans('general.notes') }}</th>
|
|
|
|
<th class="col-md-2"></th>
|
|
|
|
<th class="col-md-4"><span class="line"></span>{{ trans('general.file_name') }}</th>
|
|
|
|
<th class="col-md-2"></th>
|
|
|
|
<th class="col-md-2"></th>
|
|
|
|
</tr>
|
2016-03-25 01:18:05 -07:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2016-08-16 18:49:54 -07:00
|
|
|
@if (count($asset->uploads) > 0)
|
|
|
|
@foreach ($asset->uploads as $file)
|
|
|
|
<tr>
|
|
|
|
<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')))
|
2016-12-27 12:03:47 -08:00
|
|
|
<a href="../{{ $asset->id }}/showfile/{{ $file->id }}" data-toggle="lightbox" data-type="image"><img src="../{{ $asset->id }}/showfile/{{ $file->id }}"" class="img-thumbnail" style="max-width: 50px;"></a>
|
2016-08-16 18:49:54 -07:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ $file->filename }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
@if ($file->filename)
|
|
|
|
<a href="{{ route('show/assetfile', [$asset->id, $file->id]) }}" class="btn btn-default">{{ trans('general.download') }}</a>
|
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td>
|
2016-12-27 12:03:47 -08:00
|
|
|
@can('update', \App\Models\Asset::class)
|
|
|
|
<a class="btn delete-asset btn-danger btn-sm" href="{{ route('delete/assetfile', [$asset->id, $file->id]) }}"><i class="fa fa-trash icon-white"></i></a>
|
|
|
|
@endcan
|
2016-08-16 18:49:54 -07:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
@else
|
2016-12-27 12:03:47 -08:00
|
|
|
<tr>
|
|
|
|
<td colspan="4">
|
|
|
|
{{ trans('general.no_results') }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
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 -->
|
2016-12-27 12:03:47 -08:00
|
|
|
@stop
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
@section('moar_scripts')
|
|
|
|
<script>
|
2016-03-25 20:38:27 -07:00
|
|
|
$(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
$(this).ekkoLightbox();
|
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
@stop
|