From 146799d163eb7ffbc85ebb6b8be9d92ea90700e6 Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Thu, 13 Feb 2014 12:28:26 +0100 Subject: [PATCH 1/7] [FEATURE] show addresses from account --- public/include/pages/admin/wallet.inc.php | 2 + .../templates/mpos/admin/wallet/default.tpl | 27 ++++++++ ...t.tpl-d66ba982-20e0-419c-910c-1d20a0ff2f3a | 68 +++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 public/templates/mpos/admin/wallet/default.tpl-d66ba982-20e0-419c-910c-1d20a0ff2f3a diff --git a/public/include/pages/admin/wallet.inc.php b/public/include/pages/admin/wallet.inc.php index 909d05eff..daf8d0508 100644 --- a/public/include/pages/admin/wallet.inc.php +++ b/public/include/pages/admin/wallet.inc.php @@ -11,6 +11,7 @@ $debug->append('No cached version available, fetching from backend', 3); if ($bitcoin->can_connect() === true){ $dBalance = $bitcoin->getbalance(); + $dAddresses = $bitcoin->getaddressesbyaccount(''); $aGetInfo = $bitcoin->getinfo(); if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) { $dNewmint = $aGetInfo['newmint']; @@ -37,6 +38,7 @@ if (! $dColdCoins = $setting->getValue('wallet_cold_coins')) $dColdCoins = 0; $smarty->assign("UNCONFIRMED", $dBlocksUnconfirmedBalance); $smarty->assign("BALANCE", $dBalance); + $smarty->assign("ADDRESSES", $dAddresses); $smarty->assign("COLDCOINS", $dColdCoins); $smarty->assign("LOCKED", $dLockedBalance); $smarty->assign("NEWMINT", $dNewmint); diff --git a/public/templates/mpos/admin/wallet/default.tpl b/public/templates/mpos/admin/wallet/default.tpl index d3485a60c..f5a4d94cf 100644 --- a/public/templates/mpos/admin/wallet/default.tpl +++ b/public/templates/mpos/admin/wallet/default.tpl @@ -46,4 +46,31 @@ + + +
+ +





+
+ +
+

Addresses assigned to Default Wallet

+ + + + + + +{assign var=rank value=1} +{section address $ADDRESSES} + + + + +{/section} + +
#Address
{$rank++}{$ADDRESSES[address]}
+
\ No newline at end of file diff --git a/public/templates/mpos/admin/wallet/default.tpl-d66ba982-20e0-419c-910c-1d20a0ff2f3a b/public/templates/mpos/admin/wallet/default.tpl-d66ba982-20e0-419c-910c-1d20a0ff2f3a new file mode 100644 index 000000000..7b8b12d7e --- /dev/null +++ b/public/templates/mpos/admin/wallet/default.tpl-d66ba982-20e0-419c-910c-1d20a0ff2f3a @@ -0,0 +1,68 @@ +
+

Balance Summary

+ + + + + + + + + + + + + + + + + +{if $NEWMINT >= 0} + + + + +{/if} +
Wallet Balance{$BALANCE|number_format:"8"}
Locked for users{$LOCKED|number_format:"8"}
Unconfirmed{$UNCONFIRMED|number_format:"8"}
Liquid Assets{($BALANCE - $LOCKED)|number_format:"8"}
PoS New Mint{$NEWMINT|number_format:"8"}
+
+ +
+

Wallet Information

+ + + + + + + + + + + + + + + + + +
VersionProtocol VersionWallet VersionConnectionsErrors
{$COININFO.version|default:""}{$COININFO.protocolversion|default:""}{$COININFO.walletversion|default:""}{$COININFO.connections|default:""}{$COININFO.errors|default:"OK"}
+
+ +
+

Wallet Address Information

+ + + + + + +{assign var=rank value=1} +{section address $ADDRESSES + + + + +{/section} + +
#Address
#{$ADDRESSES[address]}
+
\ No newline at end of file From 81b8b976d10c51e51031ea11f2d0c9d2c18decb8 Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Thu, 13 Feb 2014 12:29:04 +0100 Subject: [PATCH 2/7] [FEATURE] show addresses from account --- ...t.tpl-d66ba982-20e0-419c-910c-1d20a0ff2f3a | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 public/templates/mpos/admin/wallet/default.tpl-d66ba982-20e0-419c-910c-1d20a0ff2f3a diff --git a/public/templates/mpos/admin/wallet/default.tpl-d66ba982-20e0-419c-910c-1d20a0ff2f3a b/public/templates/mpos/admin/wallet/default.tpl-d66ba982-20e0-419c-910c-1d20a0ff2f3a deleted file mode 100644 index 7b8b12d7e..000000000 --- a/public/templates/mpos/admin/wallet/default.tpl-d66ba982-20e0-419c-910c-1d20a0ff2f3a +++ /dev/null @@ -1,68 +0,0 @@ -
-

Balance Summary

- - - - - - - - - - - - - - - - - -{if $NEWMINT >= 0} - - - - -{/if} -
Wallet Balance{$BALANCE|number_format:"8"}
Locked for users{$LOCKED|number_format:"8"}
Unconfirmed{$UNCONFIRMED|number_format:"8"}
Liquid Assets{($BALANCE - $LOCKED)|number_format:"8"}
PoS New Mint{$NEWMINT|number_format:"8"}
-
- -
-

Wallet Information

- - - - - - - - - - - - - - - - - -
VersionProtocol VersionWallet VersionConnectionsErrors
{$COININFO.version|default:""}{$COININFO.protocolversion|default:""}{$COININFO.walletversion|default:""}{$COININFO.connections|default:""}{$COININFO.errors|default:"OK"}
-
- -
-

Wallet Address Information

- - - - - - -{assign var=rank value=1} -{section address $ADDRESSES - - - - -{/section} - -
#Address
#{$ADDRESSES[address]}
-
\ No newline at end of file From 224af2c9d32629c2de0cdcd79dbad8269da55dce Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Thu, 13 Feb 2014 16:29:33 +0100 Subject: [PATCH 3/7] [UPDATE] showing accounts with balance and address --- public/include/pages/admin/wallet.inc.php | 15 +- .../templates/mpos/admin/wallet/default.tpl | 145 ++++++++++-------- 2 files changed, 92 insertions(+), 68 deletions(-) diff --git a/public/include/pages/admin/wallet.inc.php b/public/include/pages/admin/wallet.inc.php index daf8d0508..2e150bc9c 100644 --- a/public/include/pages/admin/wallet.inc.php +++ b/public/include/pages/admin/wallet.inc.php @@ -11,7 +11,16 @@ $debug->append('No cached version available, fetching from backend', 3); if ($bitcoin->can_connect() === true){ $dBalance = $bitcoin->getbalance(); - $dAddresses = $bitcoin->getaddressesbyaccount(''); + + $dWalletAccounts = $bitcoin->listaccounts(); + $dAddressCount = count($dWalletAccounts); + + $dAccountAddresses = array(); + foreach($dWalletAccounts as $key => $value) + { + $dAccountAddresses[$key] = $bitcoin->getaddressesbyaccount($key); + } + $aGetInfo = $bitcoin->getinfo(); if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) { $dNewmint = $aGetInfo['newmint']; @@ -38,7 +47,9 @@ if (! $dColdCoins = $setting->getValue('wallet_cold_coins')) $dColdCoins = 0; $smarty->assign("UNCONFIRMED", $dBlocksUnconfirmedBalance); $smarty->assign("BALANCE", $dBalance); - $smarty->assign("ADDRESSES", $dAddresses); + $smarty->assign("ADDRESSCOUNT", $dAddressCount); + $smarty->assign("ACCOUNTADDRESSES", $dAccountAddresses); + $smarty->assign("ACCOUNTS", $dWalletAccounts); $smarty->assign("COLDCOINS", $dColdCoins); $smarty->assign("LOCKED", $dLockedBalance); $smarty->assign("NEWMINT", $dNewmint); diff --git a/public/templates/mpos/admin/wallet/default.tpl b/public/templates/mpos/admin/wallet/default.tpl index f5a4d94cf..f16a6dba9 100644 --- a/public/templates/mpos/admin/wallet/default.tpl +++ b/public/templates/mpos/admin/wallet/default.tpl @@ -1,76 +1,89 @@ -
-

Balance Summary

- - - - - - - - - - - - - - - - - +
+

Wallet Information - Number of Accounts in Wallet: {$ADDRESSCOUNT|default:"0"}

+ +
+

Balance Summary

+
Wallet Balance{$BALANCE|number_format:"8"}
Locked for users{$LOCKED|number_format:"8"}
Unconfirmed{$UNCONFIRMED|number_format:"8"}
Liquid Assets{($BALANCE - $LOCKED)|number_format:"8"}
+ + + + + + + + + + + + + + + + {if $NEWMINT >= 0} - - - - + + + + {/if} -
Wallet Balance{$BALANCE|number_format:"8"}
Locked for users{$LOCKED|number_format:"8"}
Unconfirmed{$UNCONFIRMED|number_format:"8"}
Liquid Assets{($BALANCE - $LOCKED)|number_format:"8"}
PoS New Mint{$NEWMINT|number_format:"8"}
PoS New Mint{$NEWMINT|number_format:"8"}
+ +
+ +
+

Network Information

+ + + + + + + + + + + + + + + + + +
VersionProtocol VersionWallet VersionConnectionsErrors
{$COININFO.version|default:""}{$COININFO.protocolversion|default:""}{$COININFO.walletversion|default:""}{$COININFO.connections|default:""}{$COININFO.errors|default:"OK"}
+
-
-

Wallet Information

- - - - - - - - - +{foreach key=NAME item=VALUE from=$ACCOUNTS} +
+

Account: {$NAME|default:"Default"}

+
+

Balance Info

+
VersionProtocol VersionWallet VersionConnectionsErrors
- - - - - + + - -
{$COININFO.version|default:""}{$COININFO.protocolversion|default:""}{$COININFO.walletversion|default:""}{$COININFO.connections|default:""}{$COININFO.errors|default:"OK"}Balance{$VALUE|number_format:"8"}
+ +
+ +{foreach key=ACCOUNT item=ADDRESS from=$ACCOUNTADDRESSES} +{if $ACCOUNT == $NAME} +
+

Addresses assigned to Account {$ACCOUNT|default:"Default"}

+ + +{foreach from=$ACCOUNTADDRESSES[$ACCOUNT] key=ACCOUNT1 item=ADDRESS1} + + + +{/foreach} + +
{$ADDRESS1}
+
+{/if} +{/foreach} +{/foreach} + -
- -





-
-
-

Addresses assigned to Default Wallet

- - - - - - -{assign var=rank value=1} -{section address $ADDRESSES} - - - - -{/section} - -
#Address
{$rank++}{$ADDRESSES[address]}
-
\ No newline at end of file From 1fd749985689c35d6345641e0ca7cefdf0c461a1 Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Thu, 13 Feb 2014 17:28:47 +0100 Subject: [PATCH 4/7] [UPDATE] style changes --- .../templates/mpos/admin/wallet/default.tpl | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/public/templates/mpos/admin/wallet/default.tpl b/public/templates/mpos/admin/wallet/default.tpl index f16a6dba9..505877f5f 100644 --- a/public/templates/mpos/admin/wallet/default.tpl +++ b/public/templates/mpos/admin/wallet/default.tpl @@ -1,5 +1,5 @@
-

Wallet Information - Number of Accounts in Wallet: {$ADDRESSCOUNT|default:"0"}

+

Wallet Information

Balance Summary

@@ -52,38 +52,39 @@
+{if $ADDRESSCOUNT > 1} +
+

Number of Accounts in Wallet: {$ADDRESSCOUNT|default:"0"}

{foreach key=NAME item=VALUE from=$ACCOUNTS} -
-

Account: {$NAME|default:"Default"}

-

Balance Info

- - - - - -
Balance{$VALUE|number_format:"8"}
-
- +

Account: {$NAME|default:"Default"}

+
+

Balance Info

+ + + + + +
Balance{$VALUE|number_format:"8"}
+
{foreach key=ACCOUNT item=ADDRESS from=$ACCOUNTADDRESSES} {if $ACCOUNT == $NAME} -
-

Addresses assigned to Account {$ACCOUNT|default:"Default"}

- - +
+

Addresses assigned to Account {$ACCOUNT|default:"Default"}

+
+ {foreach from=$ACCOUNTADDRESSES[$ACCOUNT] key=ACCOUNT1 item=ADDRESS1} - - - + + + {/foreach} - -
{$ADDRESS1}
{$ADDRESS1}
-
+ + +
{/if} {/foreach} - -
+ {/foreach} - - + +{/if} From 0ef5fdedefe347be8d88e4ba1783dbab1c87915f Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Fri, 14 Feb 2014 17:08:22 +0100 Subject: [PATCH 5/7] [UPDATE] small changes --- public/templates/mpos/admin/wallet/default.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/templates/mpos/admin/wallet/default.tpl b/public/templates/mpos/admin/wallet/default.tpl index 505877f5f..41af96265 100644 --- a/public/templates/mpos/admin/wallet/default.tpl +++ b/public/templates/mpos/admin/wallet/default.tpl @@ -30,7 +30,7 @@
-

Network Information

+

Wallet Status

From 2acf83894d7de42ca2a60fb73f71a8834aff7319 Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Sat, 15 Feb 2014 13:55:28 +0100 Subject: [PATCH 6/7] only show new table if accounts > 1 --- public/templates/mpos/admin/wallet/default.tpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/templates/mpos/admin/wallet/default.tpl b/public/templates/mpos/admin/wallet/default.tpl index 41af96265..7884cd9f3 100644 --- a/public/templates/mpos/admin/wallet/default.tpl +++ b/public/templates/mpos/admin/wallet/default.tpl @@ -1,6 +1,7 @@ +{if $ADDRESSCOUNT > 1}

Wallet Information

- +{/if}

Balance Summary

Version
@@ -50,9 +51,9 @@
+{if $ADDRESSCOUNT > 1} -{if $ADDRESSCOUNT > 1}

Number of Accounts in Wallet: {$ADDRESSCOUNT|default:"0"}

{foreach key=NAME item=VALUE from=$ACCOUNTS} From 45d79d0eab86f0be8e81d8aa2d6fe14ad88730b7 Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Sat, 15 Feb 2014 23:17:37 +0100 Subject: [PATCH 7/7] [UPDATE] style change for addresses --- public/templates/mpos/admin/wallet/default.tpl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/templates/mpos/admin/wallet/default.tpl b/public/templates/mpos/admin/wallet/default.tpl index 7884cd9f3..37cf18d2d 100644 --- a/public/templates/mpos/admin/wallet/default.tpl +++ b/public/templates/mpos/admin/wallet/default.tpl @@ -57,9 +57,9 @@

Number of Accounts in Wallet: {$ADDRESSCOUNT|default:"0"}

{foreach key=NAME item=VALUE from=$ACCOUNTS} -
+

Account: {$NAME|default:"Default"}

-
+

Balance Info

@@ -75,9 +75,13 @@
{foreach from=$ACCOUNTADDRESSES[$ACCOUNT] key=ACCOUNT1 item=ADDRESS1} - +{if $ADDRESS1@iteration is even by 1} +{else} + + +{/if} {/foreach}
{$ADDRESS1}
{$ADDRESS1}