From d494e495715e1dca056a05442e83dfb16a0c0354 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Sun, 21 Jun 2026 10:10:17 +0100 Subject: Persist filter params through smartlink sort clicks on list pages Populate listInfo['parameters'] on list_movements, list_assemblies, and list_components so icontrol carries part_content_id/ref_type/user_id/ gallery_id/hide_kitlocker through sort URLs. Wire icontrol=$listInfo on list_movements.tpl sort headers which were previously missing it. Co-Authored-By: Claude Sonnet 4.6 --- list_assemblies.php | 4 ++++ list_components.php | 5 +++++ list_movements.php | 5 +++++ templates/list_movements.tpl | 8 ++++---- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/list_assemblies.php b/list_assemblies.php index 6f428f6..5966cf8 100755 --- a/list_assemblies.php +++ b/list_assemblies.php @@ -37,6 +37,10 @@ if (!empty($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) { $galleryList = $gStockAssembly->getList( $_REQUEST ); $gStockAssembly->invokeServices( 'content_list_function', $_REQUEST ); +$_REQUEST['listInfo']['parameters'] = array_filter( [ + 'user_id' => !empty( $_REQUEST['user_id'] ) ? (int)$_REQUEST['user_id'] : '', + 'gallery_id' => !empty( $_REQUEST['gallery_id'] ) ? (int)$_REQUEST['gallery_id'] : '', +] ); $gBitSmarty->assign( 'listInfo', $_REQUEST['listInfo'] ); $gBitSmarty->assign( 'galleryList', $galleryList ); diff --git a/list_components.php b/list_components.php index 9bb68ac..21ede86 100644 --- a/list_components.php +++ b/list_components.php @@ -29,6 +29,11 @@ if( !isset( $_REQUEST['hide_kitlocker'] ) && empty( $_REQUEST['filter_submitted' $componentList = $component->getList( $_REQUEST ); $component->invokeServices( 'content_list_function', $_REQUEST ); +$_REQUEST['listInfo']['parameters'] = array_filter( [ + 'user_id' => !empty( $_REQUEST['user_id'] ) ? (int)$_REQUEST['user_id'] : '', + 'hide_kitlocker' => $_REQUEST['hide_kitlocker'] ?? '', + 'filter_submitted' => $_REQUEST['filter_submitted'] ?? '', +] ); $gBitSmarty->assign( 'listInfo', $_REQUEST['listInfo'] ); $gBitSmarty->assign( 'componentList', $componentList ); $gBitSmarty->assign( 'hideKitlocker', (bool)$_REQUEST['hide_kitlocker'] ); diff --git a/list_movements.php b/list_movements.php index 700c824..ddb2b1c 100644 --- a/list_movements.php +++ b/list_movements.php @@ -59,6 +59,11 @@ if( $filterUserId ) { $filterUserName = $uRow['real_name'] ?: $uRow['login'] ?: ''; } +$listHash['listInfo']['parameters'] = array_filter( [ + 'part_content_id' => $partContentId ?: '', + 'ref_type' => $_REQUEST['ref_type'] ?? '', + 'user_id' => $filterUserId ?: '', +] ); $gBitSmarty->assign( 'listInfo', $listHash['listInfo'] ); $gBitSmarty->assign( 'movementList', $movementList ); $gBitSmarty->assign( 'filterType', $_REQUEST['ref_type'] ?? '' ); diff --git a/templates/list_movements.tpl b/templates/list_movements.tpl index 424fff9..ec9f4fa 100644 --- a/templates/list_movements.tpl +++ b/templates/list_movements.tpl @@ -46,12 +46,12 @@ - + {if $partContentId}{/if} - - - + + + {if $gBitUser->hasPermission('p_stock_update')}{/if} -- cgit v1.3
{smartlink ititle="Reference" isort="title"}{smartlink ititle="Reference" isort="title" icontrol=$listInfo} {tr}Type{/tr}{tr}Qty{/tr}{smartlink ititle="Ordered" isort="ref_start_date" ifile="list_movements.php" ipackage="stock"}{smartlink ititle="Received" isort="event_time" ifile="list_movements.php" ipackage="stock"}{smartlink ititle="Date" isort="created_desc"}{smartlink ititle="Ordered" isort="ref_start_date" ifile="list_movements.php" ipackage="stock" icontrol=$listInfo}{smartlink ititle="Received" isort="event_time" ifile="list_movements.php" ipackage="stock" icontrol=$listInfo}{smartlink ititle="Date" isort="created_desc" icontrol=$listInfo} {tr}Creator{/tr}