From 5ef89d759eacfdee3058c35a127454f2df326163 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Thu, 16 Apr 2015 10:19:56 +0200 Subject: [PATCH] [ADDED] List last N transactions in Admin Wallet Info * N default is 25 * Can be set via Admin System Settings -> Wallet --- include/config/admin_settings.inc.php | 7 ++++ include/pages/admin/wallet.inc.php | 8 +++-- templates/bootstrap/admin/wallet/default.tpl | 1 + .../bootstrap/admin/wallet/transactions.tpl | 33 +++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 templates/bootstrap/admin/wallet/transactions.tpl diff --git a/include/config/admin_settings.inc.php b/include/config/admin_settings.inc.php index 8a5c5ee2..9b88597e 100644 --- a/include/config/admin_settings.inc.php +++ b/include/config/admin_settings.inc.php @@ -146,6 +146,13 @@ $aSettings['wallet'][] = array( 'name' => 'wallet_cold_coins', 'value' => $setting->getValue('wallet_cold_coins'), 'tooltip' => 'Amount of coins held in a pools cold wallet.' ); +$aSettings['wallet'][] = array( + 'display' => 'Transaction Limit', 'type' => 'text', + 'size' => 6, + 'default' => 25, + 'name' => 'wallet_transaction_limit', 'value' => $setting->getValue('wallet_transaction_limit'), + 'tooltip' => 'Maximum amount of transactions to list in Admin Wallet Info.' +); $aSettings['statistics'][] = array( 'display' => 'Ajax Refresh Interval', 'type' => 'select', 'options' => array('5' => '5', '10' => '10', '15' => '15', '30' => '30', '60' => '60' ), diff --git a/include/pages/admin/wallet.inc.php b/include/pages/admin/wallet.inc.php index f3ac9d7c..66c11ebe 100644 --- a/include/pages/admin/wallet.inc.php +++ b/include/pages/admin/wallet.inc.php @@ -23,6 +23,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $aGetInfo = $bitcoin->getinfo(); $aGetPeerInfo = $bitcoin->getpeerinfo(); + $aGetTransactions = $bitcoin->listtransactions('', (int)$setting->getValue('wallet_transaction_limit', 25)); if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) { $dNewmint = $aGetInfo['newmint']; } else { @@ -34,6 +35,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $dAccountAddresses = array(); $aGetInfo = array('errors' => 'Unable to connect'); $aGetPeerInfo = array(); + $aGetTransactions = array(); $dBalance = 0; $dNewmint = -1; $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to wallet RPC service: ' . $bitcoin->can_connect(), 'TYPE' => 'alert alert-danger'); @@ -50,6 +52,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { // Cold wallet balance if (! $dColdCoins = $setting->getValue('wallet_cold_coins')) $dColdCoins = 0; + + // Tempalte specifics $smarty->assign("UNCONFIRMED", $dBlocksUnconfirmedBalance); $smarty->assign("BALANCE", $dBalance); $smarty->assign("ADDRESSCOUNT", $dAddressCount); @@ -60,8 +64,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $smarty->assign("NEWMINT", $dNewmint); $smarty->assign("COININFO", $aGetInfo); $smarty->assign("PEERINFO", $aGetPeerInfo); - - // Tempalte specifics + $smarty->assign('PRECISION', $coin->getCoinValuePrevision()); + $smarty->assign("TRANSACTIONS", $aGetTransactions); } else { $debug->append('Using cached page', 3); } diff --git a/templates/bootstrap/admin/wallet/default.tpl b/templates/bootstrap/admin/wallet/default.tpl index 8be01f41..e0f5eedb 100644 --- a/templates/bootstrap/admin/wallet/default.tpl +++ b/templates/bootstrap/admin/wallet/default.tpl @@ -2,5 +2,6 @@ {include file="admin/wallet/balance.tpl"} {include file="admin/wallet/status.tpl"} {include file="admin/wallet/peers.tpl"} + {include file="admin/wallet/transactions.tpl"} {include file="admin/wallet/accounts.tpl"} diff --git a/templates/bootstrap/admin/wallet/transactions.tpl b/templates/bootstrap/admin/wallet/transactions.tpl new file mode 100644 index 00000000..fa00110e --- /dev/null +++ b/templates/bootstrap/admin/wallet/transactions.tpl @@ -0,0 +1,33 @@ +
+
+
+
+ Last {$TRANSACTIONS|count} transactions +
+
+ + + + + + + + + + + + +{foreach key=KEY item=ARRAY from=$TRANSACTIONS} + + + + + + + +{/foreach} + +
AccountAddressCategoryAmountConfirmationsTime
{$ARRAY['account']|default:"Default"}{$ARRAY['address']}{$ARRAY['category']|capitalize}{$ARRAY['amount']|number_format:"$PRECISION"}{$ARRAY['confirmations']}{$ARRAY['time']|date_format:$GLOBAL.config.date} +
+
+