Check that there is an assetstatus

This commit is contained in:
snipe
2015-07-09 07:08:33 -07:00
parent 15e1774a13
commit 1c2a409e6a
2 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
return array (
'app_version' => 'v2.0-pre',
'hash_version' => 'v2.0-pre-beta-2-gc61adc7',
'hash_version' => 'v2.0-pre-beta-3-g16b49c2',
);
+9 -5
View File
@@ -1058,11 +1058,15 @@ class AssetsController extends AdminController
$inout = new \Chumper\Datatable\Columns\FunctionColumn('inout', function ($assets)
{
if ($assets->assetstatus->deployable != 0) {
if (($assets->assigned_to !='') && ($assets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $assets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
return '<a href="'.route('checkout/hardware', $assets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
if ($assets->assetstatus) {
if ($assets->assetstatus->deployable != 0) {
if (($assets->assigned_to !='') && ($assets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $assets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
return '<a href="'.route('checkout/hardware', $assets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
}
}
}
});