Render product Userfields also on the shopping list (this now closes #258)

This commit is contained in:
Bernd Bestel 2019-09-17 19:39:55 +02:00
parent 0fa0138972
commit 9b5f3ba7b8
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 15 additions and 1 deletions

View File

@ -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)

View File

@ -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')
]);
}

View File

@ -81,6 +81,11 @@
<th>{{ $__t('Amount') }}</th>
<th class="d-none">Hiden product group</th>
<th class="d-none">Hidden status</th>
@include('components.userfields_thead', array(
'userfields' => $userfields
))
</tr>
</thead>
<tbody class="d-none">
@ -114,6 +119,12 @@
<td class="d-none">
@if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $listItem->product_id) !== null) belowminstockamount @endif
</td>
@include('components.userfields_tbody', array(
'userfields' => $userfields,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $listItem->product_id)
))
</tr>
@endforeach
</tbody>