Hotfixes adding company name to custom report

This commit is contained in:
snipe 2016-09-20 00:49:08 -07:00
parent 04898c49b2
commit d3d36315d3

View file

@ -396,6 +396,9 @@ class ReportsController extends Controller
$rows = [ ]; $rows = [ ];
$header = [ ]; $header = [ ];
if (e(Input::get('company_name')) == '1') {
$header[] = 'Company Name';
}
if (e(Input::get('asset_name')) == '1') { if (e(Input::get('asset_name')) == '1') {
$header[] = 'Asset Name'; $header[] = 'Asset Name';
} }
@ -461,6 +464,10 @@ class ReportsController extends Controller
foreach ($assets as $asset) { foreach ($assets as $asset) {
$row = [ ]; $row = [ ];
if (e(Input::get('company_name')) == '1') {
$row[] = is_null($asset->company) ? '' : e($asset->company->name);
}
if (e(Input::get('asset_name')) == '1') { if (e(Input::get('asset_name')) == '1') {
$row[] = '"' .e($asset->name) . '"'; $row[] = '"' .e($asset->name) . '"';
} }