diff options
Diffstat (limited to 'list_stock.php')
| -rw-r--r-- | list_stock.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/list_stock.php b/list_stock.php index 3de65e4..850b024 100644 --- a/list_stock.php +++ b/list_stock.php @@ -6,6 +6,8 @@ namespace Bitweaver\Stock; +use Bitweaver\BitBase; + require_once '../kernel/includes/setup_inc.php'; global $gBitSystem, $gBitSmarty, $gBitDb; @@ -31,6 +33,16 @@ if( $filterUserId ) { $X = BIT_DB_PREFIX; +$listHash = $_REQUEST; +if( !$assemblyContentId ) { + if( empty( $listHash['max_records'] ) ) { + $listHash['max_records'] = 20; + } + BitBase::prepGetList( $listHash ); +} +$maxRecords = $listHash['max_records'] ?? 20; +$offset = $listHash['offset'] ?? 0; + $bindVars = []; if( $assemblyContentId ) { @@ -203,6 +215,17 @@ if( $showShortages && isset( $_REQUEST['format'] ) && $_REQUEST['format'] === 'c exit; } +if( !$assemblyContentId ) { + $listHash['cant'] = count( $stockList ); + $stockList = array_slice( $stockList, $offset, $maxRecords, true ); + $listHash['page_records'] = count( $stockList ); + if( $filterUserId ) $listHash['listInfo']['parameters']['user_id'] = $filterUserId; + if( $find !== '' ) $listHash['listInfo']['parameters']['find'] = $find; + if( $showShortages ) $listHash['listInfo']['parameters']['shortages'] = 1; + BitBase::postGetList( $listHash ); + $gBitSmarty->assign( 'listInfo', $listHash['listInfo'] ); +} + $gBitSmarty->assign( 'stockList', $stockList ); $gBitSmarty->assign( 'assemblyListJson', $assemblyListJson ); $gBitSmarty->assign( 'assemblyContentId', $assemblyContentId ); |
