Skip to content

Commit f5d4eb5

Browse files
committed
Merge pull request #897 from madd15/patch-2
Fix #896 - Only show Checkout/Checkin if deployable
2 parents 9936cf4 + a22687a commit f5d4eb5

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

app/controllers/admin/AssetsController.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,15 +1039,16 @@ public function getDatatable($status = null)
10391039

10401040
});
10411041

1042-
$inout = new \Chumper\Datatable\Columns\FunctionColumn('inout', function ($assets)
1043-
{
1044-
if (($assets->assigned_to !='') && ($assets->assigned_to > 0)) {
1045-
return '<a href="'.route('checkin/hardware', $assets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
1046-
} else {
1047-
return '<a href="'.route('checkout/hardware', $assets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
1048-
}
1049-
});
1050-
1042+
$inout = new \Chumper\Datatable\Columns\FunctionColumn('inout', function ($assets)
1043+
{
1044+
if ($assets->assetstatus->deployable != 0) {
1045+
if (($assets->assigned_to !='') && ($assets->assigned_to > 0)) {
1046+
return '<a href="'.route('checkin/hardware', $assets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
1047+
} else {
1048+
return '<a href="'.route('checkout/hardware', $assets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
1049+
}
1050+
}
1051+
});
10511052

10521053

10531054
return Datatable::collection($assets)

0 commit comments

Comments
 (0)