Merge branch 'patch-1' of github.com:flashingcursor/snipe-it into develop
This commit is contained in:
@@ -273,7 +273,7 @@ class AssetsController extends AdminController {
|
||||
|
||||
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to("assets/$assetId/edit")->with('error', Lang::get('admin/hardware/message.update.error'));
|
||||
return Redirect::to("hardware/$assetId/edit")->with('error', Lang::get('admin/hardware/message.update.error'));
|
||||
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ class AssetsController extends AdminController {
|
||||
}
|
||||
|
||||
// Redirect to the asset management page with error
|
||||
return Redirect::to("assets/$assetId/checkout")->with('error', Lang::get('admin/hardware/message.checkout.error'));
|
||||
return Redirect::to("hardware/$assetId/checkout")->with('error', Lang::get('admin/hardware/message.checkout.error'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class ModelsController extends AdminController {
|
||||
$view->with('category_list',$category_list);
|
||||
$view->with('depreciation_list',$depreciation_list);
|
||||
$view->with('manufacturer_list',$manufacturer_list);
|
||||
$view->with('model',new Model);
|
||||
$view->with('model',new Model);
|
||||
return $view;
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ class ModelsController extends AdminController {
|
||||
if($model->save())
|
||||
{
|
||||
// Redirect to the new model page
|
||||
return Redirect::to("assets/models/$modelId/edit")->with('success', Lang::get('admin/models/message.update.success'));
|
||||
return Redirect::to("hardware/models/$modelId/edit")->with('success', Lang::get('admin/models/message.update.success'));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -167,7 +167,7 @@ class ModelsController extends AdminController {
|
||||
}
|
||||
|
||||
// Redirect to the model create page
|
||||
return Redirect::to("assets/models/$modelId/edit")->with('error', Lang::get('admin/models/message.update.error'));
|
||||
return Redirect::to("hardware/models/$modelId/edit")->with('error', Lang::get('admin/models/message.update.error'));
|
||||
|
||||
}
|
||||
|
||||
@@ -183,19 +183,19 @@ class ModelsController extends AdminController {
|
||||
if (is_null($model = Model::find($modelId)))
|
||||
{
|
||||
// Redirect to the blogs management page
|
||||
return Redirect::to('assets/models')->with('error', Lang::get('admin/models/message.not_found'));
|
||||
return Redirect::to('hardware/models')->with('error', Lang::get('admin/models/message.not_found'));
|
||||
}
|
||||
|
||||
if ($model->assets->count() > 0) {
|
||||
// Throw an error that this model is associated with assets
|
||||
return Redirect::to('assets/models')->with('error', Lang::get('admin/models/message.assoc_users'));
|
||||
return Redirect::to('hardware/models')->with('error', Lang::get('admin/models/message.assoc_users'));
|
||||
|
||||
} else {
|
||||
// Delete the model
|
||||
$model->delete();
|
||||
|
||||
// Redirect to the models management page
|
||||
return Redirect::to('assets/models')->with('success', Lang::get('admin/models/message.delete.success'));
|
||||
return Redirect::to('hardware/models')->with('success', Lang::get('admin/models/message.delete.success'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,16 +117,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Depreciation -->
|
||||
<div class="form-group {{ $errors->has('depreciation_id') ? ' has-error' : '' }}">
|
||||
<label for="parent" class="col-md-2 control-label">Depreciation</label>
|
||||
<div class="col-md-7">
|
||||
{{ Form::select('depreciation_id', $depreciation_list , Input::old('depreciation_id', $asset->depreciation_id), array('class'=>'select2', 'style'=>'width:350px')) }}
|
||||
{{ $errors->first('depreciation_id', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Status -->
|
||||
<div class="form-group {{ $errors->has('status_id') ? ' has-error' : '' }}">
|
||||
<label for="parent" class="col-md-2 control-label">Status</label>
|
||||
|
||||
@@ -8,201 +8,203 @@ View Asset {{ $asset->asset_tag }} ::
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div id="pad-wrapper" class="user-profile">
|
||||
<!-- header -->
|
||||
<h3 class="name">History for {{ $asset->asset_tag }} ({{ $asset->name }})
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn glow">Actions</button>
|
||||
<button class="btn glow dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<div class="row header">
|
||||
<div class="col-md-12">
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn glow">Actions</button>
|
||||
<button class="btn glow dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
@if ($asset->status_id == 1)
|
||||
@if ($asset->assigned_to != 0)
|
||||
<li><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat info">Checkin</a></li>
|
||||
@endif
|
||||
@elseif ($asset->status_id == 0)
|
||||
<li><a href="{{ route('checkout/hardware', $asset->id) }}" class="btn-flat success">Checkout</a></li>
|
||||
@endif
|
||||
<li><a href="{{ route('update/hardware', $asset->id) }}">Edit Asset</a></li>
|
||||
<li><a href="{{ route('clone/hardware', $asset->id) }}">Clone Asset</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</h3>
|
||||
<div class="row-fluid profile">
|
||||
<!-- bio, new note & orders column -->
|
||||
<div class="col-md-9 bio">
|
||||
<div class="profile-box">
|
||||
@if ($asset->status_id == 1)
|
||||
@if ($asset->assigned_to != 0)
|
||||
<li><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat info">Checkin</a></li>
|
||||
@endif
|
||||
@elseif ($asset->status_id == 0)
|
||||
<li><a href="{{ route('checkout/hardware', $asset->id) }}" class="btn-flat success">Checkout</a></li>
|
||||
@endif
|
||||
<li><a href="{{ route('update/hardware', $asset->id) }}">Edit Asset</a></li>
|
||||
<li><a href="{{ route('clone/hardware', $asset->id) }}">Clone Asset</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h3>
|
||||
<h3 class="name">History for {{ $asset->asset_tag }} ({{ $asset->name }})
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- details snapshot box -->
|
||||
<div class="row-fluid show-grid">
|
||||
<div class="col-md-9"></div>
|
||||
<div class="user-profile">
|
||||
<div class="row profile">
|
||||
<div class="col-md-9 bio">
|
||||
|
||||
<div class="col-md-12" style="min-height: 130px;">
|
||||
|
||||
@if ($asset->model->manufacturer)
|
||||
<div class="col-md-6"><strong>Manufacturer: </strong> {{ $asset->model->manufacturer->name }} </div>
|
||||
<div class="col-md-6"><strong>Model:</strong> {{ $asset->model->name }} / {{ $asset->model->modelno }}</div>
|
||||
@endif
|
||||
|
||||
@if ($asset->purchase_date)
|
||||
<div class="col-md-6"><strong>Purchased On: </strong>{{ $asset->purchase_date }} </div>
|
||||
@endif
|
||||
|
||||
@if ($asset->purchase_cost)
|
||||
<div class="col-md-6"><strong>Purchase Cost:</strong> ${{ number_format($asset->purchase_cost,2) }} </div>
|
||||
@endif
|
||||
|
||||
@if ($asset->order_number)
|
||||
<div class="col-md-6"><strong>Order #:</strong> {{ $asset->order_number }} </div>
|
||||
@endif
|
||||
|
||||
@if ($asset->warranty_months)
|
||||
<div class="col-md-6"><strong>Warranty:</strong> {{ $asset->warranty_months }} months</div>
|
||||
<div class="col-md-6"><strong>Expires:</strong> {{ $asset->warrantee_expires() }}</div>
|
||||
@endif
|
||||
|
||||
@if ($asset->depreciation)
|
||||
<div class="col-md-6"><strong>Depreciation: </strong>{{ $asset->depreciation->name }}
|
||||
({{ $asset->depreciation->months }} months)</div>
|
||||
<div class="col-md-6"><strong>Depreciates On: </strong>{{ $asset->depreciated_date() }} </div>
|
||||
<div class="col-md-6"><strong>Fully Depreciated: </strong>{{ $asset->months_until_depreciated()->m }} months,
|
||||
{{ $asset->months_until_depreciated()->y }} years</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($asset->model->manufacturer)
|
||||
<div class="col-md-4"><strong>Manufacturer: </strong> {{ $asset->model->manufacturer->name }} </div>
|
||||
<div class="col-md-6"><strong>Model:</strong> {{ $asset->model->name }} / {{ $asset->model->modelno }}</div>
|
||||
@endif
|
||||
|
||||
@if ($asset->purchase_date)
|
||||
<div class="col-md-4"><strong>Purchased On: </strong>{{ $asset->purchase_date }} </div>
|
||||
@endif
|
||||
|
||||
@if ($asset->purchase_cost)
|
||||
<div class="col-md-4"><strong>Purchase Cost:</strong> ${{ number_format($asset->purchase_cost,2) }} </div>
|
||||
@endif
|
||||
|
||||
@if ($asset->order_number)
|
||||
<div class="col-md-4"><strong>Order #:</strong> {{ $asset->order_number }} </div>
|
||||
@endif
|
||||
|
||||
@if ($asset->warranty_months)
|
||||
<div class="col-md-4"><strong>Warranty:</strong> {{ $asset->warranty_months }} months</div>
|
||||
<div class="col-md-4"><strong>Expires:</strong> {{ $asset->warrantee_expires() }}</div>
|
||||
@endif
|
||||
|
||||
@if ($asset->depreciation)
|
||||
<div class="col-md-4"><strong>Depreciation: </strong>{{ $asset->depreciation->name }}
|
||||
({{ $asset->depreciation->months }} months)</div>
|
||||
<div class="col-md-4"><strong>Depreciates On: </strong>{{ $asset->depreciated_date() }} </div>
|
||||
<div class="col-md-4"><strong>Fully Depreciated: </strong>{{ $asset->months_until_depreciated()->m }} months,
|
||||
{{ $asset->months_until_depreciated()->y }} years</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- checked out assets table -->
|
||||
|
||||
<br>
|
||||
<!-- checked out assets table -->
|
||||
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1"></th>
|
||||
<th class="col-md-3"><span class="line"></span>Date</th>
|
||||
<th class="col-md-2"><span class="line"></span>Admin</th>
|
||||
<th class="col-md-2"><span class="line"></span>Action</th>
|
||||
<th class="col-md-2"><span class="line"></span>User</th>
|
||||
<th class="col-md-3"><span class="line"></span>Note</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (count($asset->assetlog) > 0)
|
||||
@foreach ($asset->assetlog as $log)
|
||||
<tr>
|
||||
<td>
|
||||
@if ((isset($log->checkedout_to)) && ($log->checkedout_to == $asset->assigned_to))
|
||||
<i class="icon-star"></i>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $log->added_on }}</td>
|
||||
<td>
|
||||
@if (isset($log->user_id))
|
||||
{{ $log->adminlog->fullName() }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $log->action_type }}</td>
|
||||
<td>
|
||||
@if (isset($log->checkedout_to))
|
||||
<a href="{{ route('view/user', $log->checkedout_to) }}">
|
||||
{{ $log->userlog->fullName() }}
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($log->note)
|
||||
{{ $log->note }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{{ $asset->created_at }}</td>
|
||||
<td>
|
||||
@if ($asset->adminuser->id)
|
||||
{{ $asset->adminuser->fullName() }}
|
||||
@else
|
||||
Unknown Admin
|
||||
@endif
|
||||
</td>
|
||||
<td>created asset</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- side address column -->
|
||||
<div class="col-md-3 address pull-right">
|
||||
|
||||
@if ((isset($asset->assigned_to ) && ($asset->assigned_to > 0)))
|
||||
<h6><br>Checked Out To:</h6>
|
||||
<ul>
|
||||
|
||||
<li><img src="{{ $asset->assigneduser->gravatar() }}" class="img-circle" style="width: 100px; margin-right: 20px;" /><br /><br /></li>
|
||||
<li><a href="{{ route('view/user', $asset->assigned_to) }}">{{ $asset->assigneduser->fullName() }}</a></li>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1"></th>
|
||||
<th class="col-md-3"><span class="line"></span>Date</th>
|
||||
<th class="col-md-2"><span class="line"></span>Admin</th>
|
||||
<th class="col-md-2"><span class="line"></span>Action</th>
|
||||
<th class="col-md-2"><span class="line"></span>User</th>
|
||||
<th class="col-md-3"><span class="line"></span>Note</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (count($asset->assetlog) > 0)
|
||||
@foreach ($asset->assetlog as $log)
|
||||
<tr>
|
||||
<td>
|
||||
@if ((isset($log->checkedout_to)) && ($log->checkedout_to == $asset->assigned_to))
|
||||
<i class="icon-star"></i>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $log->added_on }}</td>
|
||||
<td>
|
||||
@if (isset($log->user_id))
|
||||
{{ $log->adminlog->fullName() }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $log->action_type }}</td>
|
||||
<td>
|
||||
@if (isset($log->checkedout_to))
|
||||
<a href="{{ route('view/user', $log->checkedout_to) }}">
|
||||
{{ $log->userlog->fullName() }}
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($log->note)
|
||||
{{ $log->note }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{{ $asset->created_at }}</td>
|
||||
<td>
|
||||
@if ($asset->adminuser->id)
|
||||
{{ $asset->adminuser->fullName() }}
|
||||
@else
|
||||
Unknown Admin
|
||||
@endif
|
||||
</td>
|
||||
<td>created asset</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
@if (isset($asset->assetloc->address))
|
||||
<li>{{ $asset->assetloc->address }}
|
||||
@if (isset($asset->assetloc->address2))
|
||||
{{ $asset->assetloc->address2 }}
|
||||
@endif
|
||||
</li>
|
||||
@if (isset($asset->assetloc->city))
|
||||
<li>{{ $asset->assetloc->city }}, {{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}</li>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endif
|
||||
<!-- side address column -->
|
||||
<div class="col-md-3 col-xs-12 address pull-right">
|
||||
|
||||
@if (isset($asset->assigneduser->email))
|
||||
<li><br /><i class="icon-envelope-alt"></i> <a href="mailto:{{ $asset->assigneduser->email }}">{{ $asset->assigneduser->email }}</a></li>
|
||||
@endif
|
||||
@if ((isset($asset->assigned_to ) && ($asset->assigned_to > 0)))
|
||||
<h6><br>Checked Out To:</h6>
|
||||
<ul>
|
||||
|
||||
@if (isset($asset->assigneduser->phone))
|
||||
<li><i class="icon-phone"></i> {{ $asset->assigneduser->phone }}</li>
|
||||
@endif
|
||||
<li><img src="{{ $asset->assigneduser->gravatar() }}" class="img-circle" style="width: 100px; margin-right: 20px;" /><br /><br /></li>
|
||||
<li><a href="{{ route('view/user', $asset->assigned_to) }}">{{ $asset->assigneduser->fullName() }}</a></li>
|
||||
|
||||
<li><br /><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat large info ">Checkin Asset</a></li>
|
||||
</ul>
|
||||
|
||||
@elseif (($asset->status_id ) && ($asset->status_id > 1))
|
||||
@if (isset($asset->assetloc->address))
|
||||
<li>{{ $asset->assetloc->address }}
|
||||
@if (isset($asset->assetloc->address2))
|
||||
{{ $asset->assetloc->address2 }}
|
||||
@endif
|
||||
</li>
|
||||
@if (isset($asset->assetloc->city))
|
||||
<li>{{ $asset->assetloc->city }}, {{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}</li>
|
||||
@endif
|
||||
|
||||
@if ($asset->assetstatus)
|
||||
<h6><br>{{ $asset->assetstatus->name }} Asset</h6>
|
||||
@endif
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="alert alert-warning alert-block">
|
||||
<i class="icon-warning-sign"></i>
|
||||
<strong>Warning: </strong> This asset has been marked <strong>{{ $asset->assetstatus->name }}</strong> and is currently undeployable.
|
||||
If this status has changed, please update the asset status.
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if (isset($asset->assigneduser->email))
|
||||
<li><br /><i class="icon-envelope-alt"></i> <a href="mailto:{{ $asset->assigneduser->email }}">{{ $asset->assigneduser->email }}</a></li>
|
||||
@endif
|
||||
|
||||
@elseif ($asset->status_id == NULL)
|
||||
<h6><br>Pending Asset</h6>
|
||||
<div class="col-md-6">
|
||||
<div class="alert alert-info alert-block">
|
||||
<i class="icon-info-sign"></i>
|
||||
<strong>Warning: </strong> This asset has been marked as pending and is currently undeployable.
|
||||
If this status has changed, please update the asset status.
|
||||
</div>
|
||||
</div>
|
||||
@if (isset($asset->assigneduser->phone))
|
||||
<li><i class="icon-phone"></i> {{ $asset->assigneduser->phone }}</li>
|
||||
@endif
|
||||
|
||||
@else
|
||||
<h6><br>Checkout Asset</h6>
|
||||
<ul>
|
||||
<li>This asset is not checked out to anyone yet. Use the button below to check it out now.</li>
|
||||
<li><br><br /><a href="{{ route('checkout/hardware', $asset->id) }}" class="btn-flat large success">Checkout Asset</a></li>
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
<li><br /><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat large info ">Checkin Asset</a></li>
|
||||
</ul>
|
||||
|
||||
@elseif (($asset->status_id ) && ($asset->status_id > 1))
|
||||
|
||||
@if ($asset->assetstatus)
|
||||
<h6><br>{{ $asset->assetstatus->name }} Asset</h6>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="alert alert-warning alert-block">
|
||||
<i class="icon-warning-sign"></i>
|
||||
<strong>Warning: </strong> This asset has been marked <strong>{{ $asset->assetstatus->name }}</strong> and is currently undeployable.
|
||||
If this status has changed, please update the asset status.
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@elseif ($asset->status_id == NULL)
|
||||
<h6><br>Pending Asset</h6>
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info alert-block">
|
||||
<i class="icon-info-sign"></i>
|
||||
<strong>Warning: </strong> This asset has been marked as pending and is currently undeployable.
|
||||
If this status has changed, please update the asset status.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
<h6><br>Checkout Asset</h6>
|
||||
<ul>
|
||||
<li>This asset is not checked out to anyone yet. Use the button below to check it out now.</li>
|
||||
<li><br><br /><a href="{{ route('checkout/hardware', $asset->id) }}" class="btn-flat large success">Checkout Asset</a></li>
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
Reference in New Issue
Block a user