Allow adjusting the tx row limit

This commit is contained in:
Sebastian Grewe 2013-07-23 09:08:57 +02:00
parent 1d6cbd44a6
commit 1a5d216b7a
2 changed files with 10 additions and 8 deletions

View File

@ -10,18 +10,20 @@ if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) {
}
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$iLimit = 30;
$debug->append('No cached version available, fetching from backend', 3);
$aTransactions = $transaction->getAllTransactions(@$_REQUEST['start'], @$_REQUEST['filter'], 5);
$aTransactions = $transaction->getAllTransactions(@$_REQUEST['start'], @$_REQUEST['filter'], $iLimit);
$iCountTransactions = $transaction->getCountAllTransactions();
$aTransactionTypes = $transaction->getTypes();
if (!$aTransactions) $_SESSION['POPUP'][] = array('CONTENT' => 'Could not find any transaction', 'TYPE' => 'errormsg');
$smarty->assign('LIMIT', $iLimit);
$smarty->assign('TRANSACTIONS', $aTransactions);
$smarty->assign('TRANSACTIONTYPES', $aTransactionTypes);
$smarty->assign('TXSTATUS', array('' => '', 'Confirmed' => 'Confirmed', 'Unconfirmed' => 'Unconfirmed', 'Orphan' => 'Orphan'));
$smarty->assign('COUNTTRANSACTIONS', $iCountTransactions);
} else {
$debug->append('Using cached page', 3);
}
$smarty->assign('TRANSACTIONS', $aTransactions);
$smarty->assign('TRANSACTIONTYPES', $aTransactionTypes);
$smarty->assign('TXSTATUS', array('' => '', 'Confirmed' => 'Confirmed', 'Unconfirmed' => 'Unconfirmed', 'Orphan' => 'Orphan'));
$smarty->assign('COUNTTRANSACTIONS', $iCountTransactions);
$smarty->assign('CONTENT', 'default.tpl');
?>

View File

@ -3,7 +3,7 @@
<tbody>
<tr>
<td class="left">
{if $COUNTTRANSACTIONS / 5 > 1}
{if $COUNTTRANSACTIONS / $LIMIT > 1}
{if $smarty.request.start > 0}
<a href="{$smarty.server.PHP_SELF}?page=admin&action=transactions&start={$smarty.request.start|default:"0" - 5}"><img src="{$PATH}/images/prev.png" /></a>
{else}
@ -12,8 +12,8 @@
{/if}
</td>
<td class="right">
{if $COUNTTRANSACTIONS / 5 > 1}
{if $COUNTTRANSACTIONS - $smarty.request.start - 5 > 0}
{if $COUNTTRANSACTIONS / $LIMIT > 1}
{if $COUNTTRANSACTIONS - $smarty.request.start - $LIMIT > 0}
<a href="{$smarty.server.PHP_SELF}?page=admin&action=transactions&start={$smarty.request.start|default:"0" + 5}"><img src="{$PATH}/images/next.png" /></a>
{else}
<img src="{$PATH}/images/next.png" />