diff --git a/changelog/52_UNRELEASED_2019-xx-xx.md b/changelog/52_UNRELEASED_2019-xx-xx.md index 90379d15..7f5bcfbd 100644 --- a/changelog/52_UNRELEASED_2019-xx-xx.md +++ b/changelog/52_UNRELEASED_2019-xx-xx.md @@ -23,6 +23,7 @@ - New Userfield type "Select list" for a list of predefined values where a single or also multiple values can then be selected on the entity object - New Userfield type "Link" - a single-line-textbox where the content will be rendered as a clickable link - Userfields of type "checkbox" are rendered as a checkmark in tables when checked (instead of "1" as till now) + - Product Userfields are now also renderd on the shopping list (for items which have a product referenced) - Fixed that the Userfield type "Preset list" had always the caption "Product group" instead of the configured one (thanks @oncleben31) - General improvements/fixes - Improved the handling which entry page to use with disabled feature flags (thanks @nielstholenaar) diff --git a/controllers/StockController.php b/controllers/StockController.php index fe100b95..70ff6a00 100644 --- a/controllers/StockController.php +++ b/controllers/StockController.php @@ -77,7 +77,9 @@ class StockController extends BaseController 'missingProducts' => $this->StockService->GetMissingProducts(), 'productGroups' => $this->Database->product_groups()->orderBy('name'), 'shoppingLists' => $this->Database->shopping_lists()->orderBy('name'), - 'selectedShoppingListId' => $listId + 'selectedShoppingListId' => $listId, + 'userfields' => $this->UserfieldsService->GetFields('products'), + 'userfieldValues' => $this->UserfieldsService->GetAllValues('products') ]); } diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php index 8a669370..bd6243b2 100644 --- a/views/shoppinglist.blade.php +++ b/views/shoppinglist.blade.php @@ -81,6 +81,11 @@ {{ $__t('Amount') }} Hiden product group Hidden status + + @include('components.userfields_thead', array( + 'userfields' => $userfields + )) + @@ -114,6 +119,12 @@ @if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $listItem->product_id) !== null) belowminstockamount @endif + + @include('components.userfields_tbody', array( + 'userfields' => $userfields, + 'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $listItem->product_id) + )) + @endforeach