@@ -1056,30 +1056,32 @@ public function getDatatable($status = null)
10561056
10571057 });
10581058
1059- $ inout = new \Chumper \Datatable \Columns \FunctionColumn ('inout ' , function ($ assets )
1059+ $ inout = new \Chumper \Datatable \Columns \FunctionColumn ('inout ' , function ($ assets )
10601060 {
1061- if (($ assets ->assigned_to !='' ) && ($ assets ->assigned_to > 0 )) {
1062- return '<a href=" ' .route ('checkin/hardware ' , $ assets ->id ).'" class="btn btn-primary btn-sm"> ' .Lang::get ('general.checkin ' ).'</a> ' ;
1063- } else {
1064- return '<a href=" ' .route ('checkout/hardware ' , $ assets ->id ).'" class="btn btn-info btn-sm"> ' .Lang::get ('general.checkout ' ).'</a> ' ;
1065- }
1061+ if ($ assets ->assetstatus ->deployable != 0 ) {
1062+ if (($ assets ->assigned_to !='' ) && ($ assets ->assigned_to > 0 )) {
1063+ return '<a href=" ' .route ('checkin/hardware ' , $ assets ->id ).'" class="btn btn-primary btn-sm"> ' .Lang::get ('general.checkin ' ).'</a> ' ;
1064+ } else {
1065+ return '<a href=" ' .route ('checkout/hardware ' , $ assets ->id ).'" class="btn btn-info btn-sm"> ' .Lang::get ('general.checkout ' ).'</a> ' ;
1066+ }
1067+ }
10661068 });
10671069
10681070
10691071
1070- return Datatable::collection ($ assets )
1071- ->addColumn ('' ,function ($ assets )
1072- {
1073- return '<input type="checkbox" name="edit_asset[ ' .$ assets ->id .']" class="one_required"> ' ;
1074- })
1075- ->addColumn ('name ' ,function ($ assets )
1076- {
1077- return '<a title=" ' .$ assets ->name .'" href="hardware/ ' .$ assets ->id .'/view"> ' .$ assets ->name .'</a> ' ;
1078- })
1079- ->addColumn ('asset_tag ' ,function ($ assets )
1080- {
1081- return '<a title=" ' .$ assets ->asset_tag .'" href="hardware/ ' .$ assets ->id .'/view"> ' .$ assets ->asset_tag .'</a> ' ;
1082- })
1072+ return Datatable::collection ($ assets )
1073+ ->addColumn ('' ,function ($ assets )
1074+ {
1075+ return '<input type="checkbox" name="edit_asset[ ' .$ assets ->id .']" class="one_required"> ' ;
1076+ })
1077+ ->addColumn ('name ' ,function ($ assets )
1078+ {
1079+ return '<a title=" ' .$ assets ->name .'" href="hardware/ ' .$ assets ->id .'/view"> ' .$ assets ->name .'</a> ' ;
1080+ })
1081+ ->addColumn ('asset_tag ' ,function ($ assets )
1082+ {
1083+ return '<a title=" ' .$ assets ->asset_tag .'" href="hardware/ ' .$ assets ->id .'/view"> ' .$ assets ->asset_tag .'</a> ' ;
1084+ })
10831085
10841086 ->showColumns ('serial ' )
10851087
0 commit comments