diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7a7319a539..4e530c7df7 100755
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -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!
\ No newline at end of file
+Please submit all issues and pull requests to the [snipe/snipe-it](http://github.com/snipe/snipe-it) repository in the develop branch!
\ No newline at end of file
diff --git a/app/database/migrations/2013_11_20_055822_add_soft_delete_on_assets.php b/app/database/migrations/2013_11_20_055822_add_soft_delete_on_assets.php
new file mode 100644
index 0000000000..24c444472f
--- /dev/null
+++ b/app/database/migrations/2013_11_20_055822_add_soft_delete_on_assets.php
@@ -0,0 +1,30 @@
+softDeletes();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ //
+ }
+
+}
\ No newline at end of file
diff --git a/app/models/Asset.php b/app/models/Asset.php
index 6c5413cb88..58f3af8a35 100644
--- a/app/models/Asset.php
+++ b/app/models/Asset.php
@@ -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',
diff --git a/app/models/License.php b/app/models/License.php
index fcad687647..ca8f60ee9b 100644
--- a/app/models/License.php
+++ b/app/models/License.php
@@ -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',
diff --git a/app/views/backend/assets/index.blade.php b/app/views/backend/assets/index.blade.php
index b33e14b8e2..aa490f45d0 100755
--- a/app/views/backend/assets/index.blade.php
+++ b/app/views/backend/assets/index.blade.php
@@ -8,8 +8,6 @@ Assets ::
{{-- Page content --}}
@section('content')
-
-
+
@if ($assets->getTotal() > 10)
{{ $assets->links() }}
@endif
diff --git a/app/views/backend/categories/index.blade.php b/app/views/backend/categories/index.blade.php
index 111eaf1110..a93ab5a5f4 100755
--- a/app/views/backend/categories/index.blade.php
+++ b/app/views/backend/categories/index.blade.php
@@ -43,7 +43,7 @@ Asset Categories ::
@lang('button.edit')
- @lang('button.delete')
+ @lang('button.delete')
|
@endforeach
diff --git a/app/views/backend/depreciations/index.blade.php b/app/views/backend/depreciations/index.blade.php
index 6a8d03bf48..f4f7cdc846 100755
--- a/app/views/backend/depreciations/index.blade.php
+++ b/app/views/backend/depreciations/index.blade.php
@@ -38,7 +38,7 @@ Asset Depreciations ::
{{ $depreciation->months }} @lang('admin/depreciations/table.months') |
@lang('button.edit')
- @lang('button.delete')
+ @lang('button.delete')
|
@endforeach
diff --git a/app/views/backend/groups/index.blade.php b/app/views/backend/groups/index.blade.php
index 3849090e80..5431627636 100755
--- a/app/views/backend/groups/index.blade.php
+++ b/app/views/backend/groups/index.blade.php
@@ -43,7 +43,7 @@ Group Management ::
{{ $group->created_at->diffForHumans() }} |
@lang('button.edit')
- @lang('button.delete')
+ @lang('button.delete')
|
@endforeach
diff --git a/app/views/backend/layouts/default.blade.php b/app/views/backend/layouts/default.blade.php
index 8a9179b602..c81aecaa4f 100755
--- a/app/views/backend/layouts/default.blade.php
+++ b/app/views/backend/layouts/default.blade.php
@@ -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('');
+ }
+
+ $('#dataConfirmModal').find('.modal-body').text(message);
+ $('#dataConfirmOK').attr('href', href);
+ $('#dataConfirmModal').modal({show:true});
+})
+
});
+
+
+
diff --git a/app/views/backend/licenses/index.blade.php b/app/views/backend/licenses/index.blade.php
index 7bb590ef7f..49bf776707 100755
--- a/app/views/backend/licenses/index.blade.php
+++ b/app/views/backend/licenses/index.blade.php
@@ -57,7 +57,11 @@ Licenses ::
@lang('button.edit')
- @lang('button.delete')
+ @lang('button.delete')
+
+
+
+
|
@endforeach
diff --git a/app/views/backend/locations/index.blade.php b/app/views/backend/locations/index.blade.php
index 4813fb0574..6a43a6c257 100755
--- a/app/views/backend/locations/index.blade.php
+++ b/app/views/backend/locations/index.blade.php
@@ -42,7 +42,7 @@ Asset Depreciations ::
{{ $location->city }}, {{ $location->state }} {{ $location->country }} |
@lang('button.edit')
- @lang('button.delete')
+ @lang('button.delete')
|
@endforeach
diff --git a/app/views/backend/manufacturers/index.blade.php b/app/views/backend/manufacturers/index.blade.php
index 67b0069049..4da51c70bb 100755
--- a/app/views/backend/manufacturers/index.blade.php
+++ b/app/views/backend/manufacturers/index.blade.php
@@ -36,7 +36,7 @@ Asset Manufacturers ::
{{ $manufacturer->name }} |
@lang('button.edit')
- @lang('button.delete')
+ @lang('button.delete')
|
@endforeach
diff --git a/app/views/backend/models/index.blade.php b/app/views/backend/models/index.blade.php
index c75e83546a..57530306d9 100755
--- a/app/views/backend/models/index.blade.php
+++ b/app/views/backend/models/index.blade.php
@@ -28,24 +28,21 @@ Asset Models ::
@lang('admin/models/table.title') |
@lang('admin/models/table.modelnumber') |
@lang('admin/models/table.numassets') |
- @lang('admin/models/table.created_at') |
+ @lang('admin/models/table.created_at') |
@lang('table.actions') |
@foreach ($models as $model)
- | {{ $model->name }}
-
-
-
- |
+ {{ $model->name }} |
{{ $model->modelno }} |
{{ ($model->assets->count()) }} |
{{ $model->created_at->diffForHumans() }} |
@lang('button.edit')
- @lang('button.delete')
+ @lang('button.delete')
+
|
@endforeach
diff --git a/app/views/backend/users/index.blade.php b/app/views/backend/users/index.blade.php
index 51dfd0400d..9f9d6655b7 100755
--- a/app/views/backend/users/index.blade.php
+++ b/app/views/backend/users/index.blade.php
@@ -71,7 +71,8 @@ User Management ::
@else
@lang('button.edit')
@if (Sentry::getId() !== $user->id)
- @lang('button.delete')
+ @lang('button.delete')
+
@else
@lang('button.delete')
@endif
diff --git a/app/views/backend/users/view.blade.php b/app/views/backend/users/view.blade.php
index 677a360469..e17e4e810e 100644
--- a/app/views/backend/users/view.blade.php
+++ b/app/views/backend/users/view.blade.php
@@ -89,7 +89,13 @@ View User {{ $user->fullName() }} ::
| {{ $log->added_on }} |
{{ $log->action_type }} |
- {{ $log->assetlog->name }} |
+
+ @if (isset($log->assetlog->name))
+ {{ $log->assetlog->name }}
+ @else
+ missing asset
+ @endif
+ |
{{ $log->adminlog->fullName() }} |
@endforeach