Added comments and spacing for readability

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-11-16 17:48:28 +00:00
parent 1122562b4e
commit 489895a5fa

View file

@ -42,12 +42,16 @@ class ViewAssetsController extends Controller
// Loop through all the custom fields that are applied to any model the user has assigned // Loop through all the custom fields that are applied to any model the user has assigned
foreach ($user->assets as $asset) { foreach ($user->assets as $asset) {
// Make sure the model has a custom fieldset before trying to loop through the associated fields
if ($asset->model->fieldset) { if ($asset->model->fieldset) {
foreach ($asset->model->fieldset->fields as $field) { foreach ($asset->model->fieldset->fields as $field) {
// check and make sure they're allowed to see the value of the custom field // check and make sure they're allowed to see the value of the custom field
if ($field->display_in_user_view == '1') { if ($field->display_in_user_view == '1') {
$field_array[$field->db_column] = $field->name; $field_array[$field->db_column] = $field->name;
} }
} }
} }