Fixed /tasks group by category (fixes #1274)

This commit is contained in:
Bernd Bestel
2021-06-28 19:31:27 +02:00
parent 69f8c237ff
commit 7587ead732
4 changed files with 13 additions and 13 deletions

View File

@@ -965,7 +965,7 @@ $(".change-table-columns-visibility-button").on("click", function(e)
return; return;
} }
var shadowColumnIndex = $(this.header()).attr("data-shodow-rowgroup-column"); var shadowColumnIndex = $(this.header()).attr("data-shadow-rowgroup-column");
if (shadowColumnIndex) if (shadowColumnIndex)
{ {
index = shadowColumnIndex; index = shadowColumnIndex;

View File

@@ -3,13 +3,8 @@
'columnDefs': [ 'columnDefs': [
{ 'orderable': false, 'targets': 0 }, { 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }, { 'searchable': false, "targets": 0 },
{ 'visible': false, 'targets': 3 },
{ "type": "html", "targets": 2 } { "type": "html", "targets": 2 }
].concat($.fn.dataTable.defaults.columnDefs), ].concat($.fn.dataTable.defaults.columnDefs)
'rowGroup': {
enable: true,
dataSrc: 3
}
}); });
$('#tasks-table tbody').removeClass("d-none"); $('#tasks-table tbody').removeClass("d-none");
tasksTable.columns.adjust().draw(); tasksTable.columns.adjust().draw();

View File

@@ -69,7 +69,7 @@
<th class="@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif">{{ $__t('Location') }}</th> <th class="@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif">{{ $__t('Location') }}</th>
<th class="@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">{{ $__t('Store') }}</th> <th class="@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">{{ $__t('Store') }}</th>
<th class="@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">{{ $__t('Price') }}</th> <th class="@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">{{ $__t('Price') }}</th>
<th data-shodow-rowgroup-column="9">{{ $__t('Purchased date') }}</th> <th data-shadow-rowgroup-column="9">{{ $__t('Purchased date') }}</th>
<th class="d-none">Hidden purchased_date</th> <th class="d-none">Hidden purchased_date</th>
@include('components.userfields_thead', array( @include('components.userfields_thead', array(

View File

@@ -107,9 +107,10 @@
</th> </th>
<th>{{ $__t('Task') }}</th> <th>{{ $__t('Task') }}</th>
<th>{{ $__t('Due') }}</th> <th>{{ $__t('Due') }}</th>
<th>{{ $__t('Category') }}</th> <th data-shadow-rowgroup-column="6">{{ $__t('Category') }}</th>
<th>{{ $__t('Assigned to') }}</th> <th>{{ $__t('Assigned to') }}</th>
<th class="d-none">Hidden status</th> <th class="d-none">Hidden status</th>
<th class="d-none">Hidden category_id</th>
@include('components.userfields_thead', array( @include('components.userfields_thead', array(
'userfields' => $userfields 'userfields' => $userfields
@@ -187,10 +188,14 @@
duesoon duesoon
@endif @endif
</td> </td>
@include('components.userfields_tbody', <td
array( 'userfields'=> $userfields, class="d-none">
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $task->id) @if($task->category_id != null) {{ FindObjectInArrayByPropertyValue($taskCategories, 'id', $task->category_id)->name }} @else {{ $__t('Uncategorized') }} @endif
)) </td>
@include('components.userfields_tbody',
array( 'userfields'=> $userfields,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $task->id)
))
</tr> </tr>
@endforeach @endforeach