Merge branch 'refs/heads/develop'
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
||||
# Contribution Guidelines
|
||||
|
||||
Please submit all issues and pull requests to the [snipe/snipe-it](http://github.com/snipe/snipe-it) repository!
|
||||
Please submit all issues and pull requests to the [snipe/snipe-it](http://github.com/snipe/snipe-it) repository in the develop branch!
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddSoftDeleteOnAssets extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('assets', function($table)
|
||||
{
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
class Asset extends Elegant {
|
||||
|
||||
protected $table = 'assets';
|
||||
protected $softDelete = true;
|
||||
protected $rules = array(
|
||||
'name' => 'required|min:3',
|
||||
'asset_tag' => 'required|min:3|unique:assets',
|
||||
|
||||
@@ -9,7 +9,7 @@ class License extends Elegant {
|
||||
*/
|
||||
|
||||
protected $table = 'assets';
|
||||
|
||||
protected $softDelete = true;
|
||||
protected $rules = array(
|
||||
'name' => 'required|min:3',
|
||||
'serial' => 'required|min:5',
|
||||
|
||||
@@ -8,8 +8,6 @@ Assets ::
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="page-header">
|
||||
<h3>
|
||||
Assets
|
||||
@@ -30,12 +28,9 @@ Assets ::
|
||||
<th class="span2">@lang('admin/assets/table.asset_tag')</th>
|
||||
<th class="span2"><span class="line"></span>@lang('admin/assets/table.title')</th>
|
||||
<th class="span2"><span class="line"></span>@lang('admin/assets/table.serial')</th>
|
||||
<th class="span3"><span class="line"></span>@lang('admin/assets/table.checkoutto')</th>
|
||||
<th class="span2"><span class="line"></span>@lang('admin/assets/table.checkoutto')</th>
|
||||
<th class="span2"><span class="line"></span>@lang('admin/assets/table.location')</th>
|
||||
<th class="span1"><span class="line"></span>@lang('admin/assets/table.change')</th>
|
||||
<th class="span2"><span class="line"></span>@lang('admin/assets/table.purchase_date')</th>
|
||||
<!-- <th class="span2"><span class="line"></span>@lang('admin/assets/table.purchase_cost')</th> -->
|
||||
<!-- <th class="span2"><span class="line"></span>@lang('admin/assets/table.book_value')</th> -->
|
||||
<th class="span2"><span class="line"></span>@lang('table.actions')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -65,14 +60,9 @@ Assets ::
|
||||
<a href="{{ route('checkout/asset', $asset->id) }}" class="btn-flat success">Checkout</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $asset->purchase_date }}</td>
|
||||
<!-- <td>${{ number_format($asset->purchase_cost) }}</td> -->
|
||||
<!-- <td>${{ number_format($asset->depreciation()) }}</td> -->
|
||||
<td nowrap="nowrap">
|
||||
|
||||
<a href="{{ route('update/asset', $asset->id) }}" class="btn-flat white">@lang('button.edit')</a>
|
||||
<a href="{{ route('delete/asset', $asset->id) }}" class="btn-flat danger">@lang('button.delete')</a>
|
||||
|
||||
<a class="btn-flat danger delete-asset" data-toggle="modal" href="{{ route('delete/asset', $asset->id) }}" data-content="Are you sure you wish to delete asset {{ $asset->asset_tag }}?" data-title="Delete {{ $asset->asset_tag }}?" onClick="return false;">@lang('button.delete')</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@@ -80,6 +70,7 @@ Assets ::
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
@if ($assets->getTotal() > 10)
|
||||
{{ $assets->links() }}
|
||||
@endif
|
||||
|
||||
@@ -43,7 +43,7 @@ Asset Categories ::
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('update/category', $category->id) }}" class="btn-flat white"> @lang('button.edit')</a>
|
||||
<a href="{{ route('delete/category', $category->id) }}" class="btn-flat danger">@lang('button.delete')</a>
|
||||
<a class="btn-flat danger delete-asset" data-toggle="modal" href="{{ route('delete/category', $category->id) }}" data-content="Are you sure you wish to delete the {{ $category->name }} category?" data-title="Delete this category?" onClick="return false;">@lang('button.delete')</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@@ -38,7 +38,7 @@ Asset Depreciations ::
|
||||
<td>{{ $depreciation->months }} @lang('admin/depreciations/table.months') </td>
|
||||
<td>
|
||||
<a href="{{ route('update/depreciations', $depreciation->id) }}" class="btn-flat white">@lang('button.edit')</a>
|
||||
<a href="{{ route('delete/depreciations', $depreciation->id) }}" class="btn-flat danger">@lang('button.delete')</a>
|
||||
<a class="btn-flat danger delete-asset" data-toggle="modal" href="{{ route('delete/depreciations', $depreciation->id) }}" data-content="Are you sure you wish to delete the {{ $depreciation->name }} depreciation class?" data-title="Delete {{ $depreciation->name }}?" onClick="return false;">@lang('button.delete')</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@@ -43,7 +43,7 @@ Group Management ::
|
||||
<td>{{ $group->created_at->diffForHumans() }}</td>
|
||||
<td>
|
||||
<a href="{{ route('update/group', $group->id) }}" class="btn-flat white">@lang('button.edit')</a>
|
||||
<a href="{{ route('delete/group', $group->id) }}" class="btn-flat danger">@lang('button.delete')</a>
|
||||
<a class="btn-flat danger delete-asset" data-toggle="modal" href="{{ route('delete/group', $group->id) }}" data-content="Are you sure you wish to delete the {{ $group->name }} group?" data-title="Delete {{ $group->name }}?" onClick="return false;">@lang('button.delete')</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@@ -296,10 +296,28 @@
|
||||
// jQuery Knobs
|
||||
$(".knob").knob();
|
||||
|
||||
// confirm delete modal
|
||||
$('.delete-asset').click(function(evnt) {
|
||||
var href = $(this).attr('href');
|
||||
var message = $(this).attr('data-content');
|
||||
var title = $(this).attr('data-title');
|
||||
|
||||
if (!$('#dataConfirmModal').length) {
|
||||
$('body').append('<div id="dataConfirmModal" class="modal" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true"><div class="modal-header"><button type="button" class="close " data-dismiss="modal" aria-hidden="true">×</button><h3 id="dataConfirmLabel">'+title+'</h3></div><div class="modal-body">'+message+'</div><div class="modal-footer"><button class="btn-flat white" data-dismiss="modal" aria-hidden="true">No</button> <a class="btn-flat danger" id="dataConfirmOK">Yes</a></div></div>');
|
||||
}
|
||||
|
||||
$('#dataConfirmModal').find('.modal-body').text(message);
|
||||
$('#dataConfirmOK').attr('href', href);
|
||||
$('#dataConfirmModal').modal({show:true});
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +57,11 @@ Licenses ::
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('update/license', $license->id) }}" class="btn-flat white"> @lang('button.edit')</a>
|
||||
<a href="{{ route('delete/license', $license->id) }}" class="btn-flat danger"> @lang('button.delete')</a>
|
||||
<a class="btn-flat danger delete-asset" data-toggle="modal" href="{{ route('delete/license', $license->id) }}" data-content="Are you sure you wish to delete the {{ $license->name }} license?" data-title="Delete {{ $license->name }}?" onClick="return false;">@lang('button.delete')</a>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@@ -42,7 +42,7 @@ Asset Depreciations ::
|
||||
<td>{{ $location->city }}, {{ $location->state }} {{ $location->country }} </td>
|
||||
<td>
|
||||
<a href="{{ route('update/location', $location->id) }}" class="btn-flat white"> @lang('button.edit')</a>
|
||||
<a href="{{ route('delete/location', $location->id) }}" class="btn-flat danger">@lang('button.delete')</a>
|
||||
<a class="btn-flat danger delete-asset" data-toggle="modal" href="{{ route('delete/location', $location->id) }}" data-content="Are you sure you wish to delete the {{ $location->name }} location?" data-title="Delete {{ $location->name }}?" onClick="return false;">@lang('button.delete')</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@@ -36,7 +36,7 @@ Asset Manufacturers ::
|
||||
<td>{{ $manufacturer->name }}</td>
|
||||
<td>
|
||||
<a href="{{ route('update/manufacturer', $manufacturer->id) }}" class="btn-flat white">@lang('button.edit')</a>
|
||||
<a href="{{ route('delete/manufacturer', $manufacturer->id) }}" class="btn-flat danger">@lang('button.delete')</a>
|
||||
<a class="btn-flat danger delete-asset" data-toggle="modal" href="{{ route('delete/manufacturer', $manufacturer->id) }}" data-content="Are you sure you wish to delete the {{ $manufacturer->name }} manufacturer?" data-title="Delete {{ $manufacturer->name }}?" onClick="return false;">@lang('button.delete')</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@@ -28,24 +28,21 @@ Asset Models ::
|
||||
<th class="span3">@lang('admin/models/table.title')</th>
|
||||
<th class="span3"><span class="line"></span>@lang('admin/models/table.modelnumber')</th>
|
||||
<th class="span1"><span class="line"></span>@lang('admin/models/table.numassets')</th>
|
||||
<th class="span1"><span class="line"></span>@lang('admin/models/table.created_at')</th>
|
||||
<th class="span2"><span class="line"></span>@lang('admin/models/table.created_at')</th>
|
||||
<th class="span3"><span class="line"></span>@lang('table.actions')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($models as $model)
|
||||
<tr>
|
||||
<td>{{ $model->name }}
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
<td>{{ $model->name }}</td>
|
||||
<td>{{ $model->modelno }}</td>
|
||||
<td>{{ ($model->assets->count()) }}</td>
|
||||
<td>{{ $model->created_at->diffForHumans() }}</td>
|
||||
<td>
|
||||
<a href="{{ route('update/model', $model->id) }}" class="btn-flat white">@lang('button.edit')</a>
|
||||
<a href="{{ route('delete/model', $model->id) }}" class="btn-flat danger">@lang('button.delete')</a>
|
||||
<a class="btn-flat danger delete-asset" data-toggle="modal" href="{{ route('delete/model', $model->id) }}" data-content="Are you sure you wish to delete the {{ $model->name }} model?" data-title="Delete {{ $model->name }}?" onClick="return false;">@lang('button.delete')</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@@ -71,7 +71,8 @@ User Management ::
|
||||
@else
|
||||
<a href="{{ route('update/user', $user->id) }}" class="btn-flat white"><i class="icon-pencil"></i> @lang('button.edit')</a>
|
||||
@if (Sentry::getId() !== $user->id)
|
||||
<a href="{{ route('delete/user', $user->id) }}" class="btn-flat danger"><i class="icon-remove icon-white"></i> @lang('button.delete')</a>
|
||||
<a class="btn-flat danger delete-asset" data-toggle="modal" href="{{ route('delete/user', $user->id) }}" data-content="Are you sure you wish to delete the user {{ $user->fullName() }}?" data-title="Delete {{ $user->first_name }}?" onClick="return false;"><i class="icon-remove icon-white"></i> @lang('button.delete')</a>
|
||||
|
||||
@else
|
||||
<span class="btn-flat danger disabled"><i class="icon-remove icon-white"></i> @lang('button.delete')</span>
|
||||
@endif
|
||||
|
||||
@@ -89,7 +89,13 @@ View User {{ $user->fullName() }} ::
|
||||
<tr>
|
||||
<td>{{ $log->added_on }}</td>
|
||||
<td>{{ $log->action_type }}</td>
|
||||
<td><a href="{{ route('view/asset', $log->asset_id) }}">{{ $log->assetlog->name }}</a></td>
|
||||
<td>
|
||||
@if (isset($log->assetlog->name))
|
||||
<a href="{{ route('view/asset', $log->asset_id) }}">{{ $log->assetlog->name }}</a>
|
||||
@else
|
||||
missing asset
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $log->adminlog->fullName() }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user