Display archived asset groups with archived label.

This commit is contained in:
paul121 2020-05-22 13:18:25 -07:00 committed by Michael Stenta
parent 94395416c7
commit 2c40b97b72
1 changed files with 5 additions and 4 deletions

View File

@ -156,9 +156,6 @@ function farm_livestock_weight_group_report_form($form, &$form_state) {
$query->entityCondition('bundle', 'group');
$query->propertyOrderBy('name', 'ASC');
// Limit to non-archived groups.
$query->propertyCondition('archived', 0);
// Execute the query and build a list of options.
$options = array();
$result = $query->execute();
@ -168,7 +165,11 @@ function farm_livestock_weight_group_report_form($form, &$form_state) {
if (!empty($groups)) {
foreach ($groups as $group) {
if (!empty($group->id)) {
$options[$group->id] = entity_label('farm_asset', $group);
$label = entity_label('farm_asset', $group);
if ($group->archived) {
$label = $label . ' (' . t('archived') . ')';
}
$options[$group->id] = $label;
}
}
}