From 7a194a629338184cbe5645eeea7c80ec712e6f9b Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 5 Jul 2013 15:30:51 +0200 Subject: [PATCH] Further attempt to clean up transactions list This hopefully cleans out remaining PHP warnings and table issues with no/partial transactions available. Please test this out and report back in #315. --- .../mmcFE/account/transactions/default.tpl | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/public/templates/mmcFE/account/transactions/default.tpl b/public/templates/mmcFE/account/transactions/default.tpl index bf64450d..160b12e4 100644 --- a/public/templates/mmcFE/account/transactions/default.tpl +++ b/public/templates/mmcFE/account/transactions/default.tpl @@ -14,6 +14,7 @@ +{assign var=has_confirmed value=false} {section transaction $TRANSACTIONS} {if ( (($TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus')and $TRANSACTIONS[transaction].confirmations >= $GLOBAL.confirmations) @@ -26,6 +27,7 @@ or $TRANSACTIONS[transaction].type == 'Debit_MP' or $TRANSACTIONS[transaction].type == 'TXFee' )} + {assign var=has_credits value=true} {$TRANSACTIONS[transaction].id} {$TRANSACTIONS[transaction].timestamp} @@ -36,6 +38,9 @@ {/if} {/section} +{if !$has_confirmed} + No data +{/if}

@@ -60,12 +65,14 @@ +{assign var=has_unconfirmed value=false} {section transaction $TRANSACTIONS} {if ( ($TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus') and $TRANSACTIONS[transaction].confirmations < $GLOBAL.confirmations or ($TRANSACTIONS[transaction].type == 'Donation' and $TRANSACTIONS[transaction].confirmations < $GLOBAL.confirmations) or ($TRANSACTIONS[transaction].type == 'Fee' and $TRANSACTIONS[transaction].confirmations < $GLOBAL.confirmations) )} + {assign var=has_unconfirmed value=true} {$TRANSACTIONS[transaction].id} {$TRANSACTIONS[transaction].timestamp} @@ -75,12 +82,15 @@ {$TRANSACTIONS[transaction].amount|number_format:"8"} {if $TRANSACTIONS[transaction].type == 'Credit' or $TRANSACTIONS[transaction].type == 'Bonus'} - {assign var="credits" value="`$credits+$TRANSACTIONS[transaction].amount`"} + {assign var="credits" value="`$credits|default:"0"+$TRANSACTIONS[transaction].amount`"} {else} - {assign var="debits" value="`$debits+$TRANSACTIONS[transaction].amount`"} + {assign var="debits" value="`$debits|default:"0"+$TRANSACTIONS[transaction].amount`"} {/if} {/if} {/section} +{if !$has_unconfirmed} + No data +{/if} Unconfirmed Totals: {($credits|default - $debits|default)|number_format:"8"} @@ -105,6 +115,7 @@ +{assign var=has_orphaned value=false} {section transaction $TRANSACTIONS} {if ( $TRANSACTIONS[transaction].type == 'Orphan_Credit' @@ -121,12 +132,15 @@ {$TRANSACTIONS[transaction].amount|number_format:"8"} {if $TRANSACTIONS[transaction].type == 'Orphan_Credit' or $TRANSACTIONS[transaction].type == 'Orphan_Bonus'} - {assign var="orphan_credits" value="`$orphan_credits+$TRANSACTIONS[transaction].amount`"} + {assign var="orphan_credits" value="`$orphan_credits|default:"0"+$TRANSACTIONS[transaction].amount`"} {else} - {assign var="orphan_debits" value="`$orphan_debits+$TRANSACTIONS[transaction].amount`"} + {assign var="orphan_debits" value="`$orphan_debits|default:"0"+$TRANSACTIONS[transaction].amount`"} {/if} {/if} {/section} +{if !$has_orphaned} + No data +{/if} Orphaned Totals: {($orphan_credits|default - $orphan_debits|default)|number_format:"8"}