sort konto overview, update menu title, tooltip for memo every time not only by long memos

This commit is contained in:
Dario Rekowski on RockPI 2019-12-19 12:30:41 +00:00
parent a3a09182e9
commit d7ba4a5d8b
6 changed files with 29 additions and 18 deletions

View File

@ -161,7 +161,7 @@ class AppController extends Controller
foreach($json['user'] as $key => $value) {
$session->write('StateUser.' . $key, $value );
}
//var_dump($json);
$transactionPendings = $json['Transaction.pending'];
//echo "read transaction pending: $transactionPendings<br>";
$session->write('Transactions.pending', $transactionPendings);

View File

@ -40,16 +40,11 @@ class StateBalancesController extends AppController
$startTime = microtime(true);
$this->viewBuilder()->setLayout('frontend_ripple');
$session = $this->getRequest()->getSession();
$user = $session->read('StateUser');
// var_dump($user);
if(!$user) {
//return $this->redirect(Router::url('/', true) . 'account/', 303);
$result = $this->requestLogin();
if($result !== true) {
return $result;
}
$user = $session->read('StateUser');
$result = $this->requestLogin();
if($result !== true) {
return $result;
}
$user = $session->read('StateUser');
$creationsTable = TableRegistry::getTableLocator()->get('TransactionCreations');
$creationTransactions = $creationsTable
@ -135,10 +130,19 @@ class StateBalancesController extends AppController
'memo' => $sendCoins->transaction->memo
]);
}
uasort($transactions, array($this, 'sortTransactions'));
$this->set('transactions', $transactions);
$this->set('balance', $session->read('StateUser.balance'));
$this->set('timeUsed', microtime(true) - $startTime);
}
public function sortTransactions($a, $b) {
if ($a['date'] == $b['date']) {
return 0;
}
return ($a['date'] > $b['date']) ? -1 : 1;
}
/**
* View method

View File

@ -1,5 +1,6 @@
<?php
use Model\Navigation\NaviEntry;
use Model\Navigation\NaviEntrySub;
use Model\Navigation\NaviEntryAbsoluteLink;
$session = $this->getRequest()->getSession();
@ -20,7 +21,11 @@ $navi = [];
->setIconColor('grd-alert-color');
array_push($navi, $errorNaviEntry);
}*/
$balanceNaviEntry = new NaviEntry($this->element('printGradido', ['number' => $balance]), 'mdi-wallet-outline', 'StateBalances', 'overview');
$balanceNaviEntry = new NaviEntry(
__('Kontoübersicht') . ' (' . $this->element('printGradido', ['number' => $balance]) . ')',
//__('Kontoübersicht'),
'mdi-wallet-outline', 'StateBalances', 'overview'
);
if($balance < 0 ) {
//$balanceNaviEntry->setIconColor('grd-alert-color');
} else if($balance > 0) {

View File

@ -42,7 +42,7 @@ $GLOBALS["self"] = $this;
<body class="header-fixed">
<div class="versionstring dev-info">
<p class="grd_small"><?= __("Community Server in Entwicklung") ?></p>
<p class="grd_small">Alpha 0.9.0</p>
<p class="grd_small">Alpha 0.10.0</p>
</div>
<nav class="t-header">
<div class="t-header-brand-wrapper">

View File

@ -73,11 +73,13 @@ $this->assign('title', __('Kontoübersicht'));
<?php endif; ?>
</span>
</td>
<td><?php if(strlen($transaction['memo']) > 30): ?>
<span data-toggle="tooltip" data-placement="bottom" title="<?= $transaction['memo'] ?>"><?= substr($memoShort, 0, 30) . '...' ?></span>
<?php else : ?>
<td><span data-toggle="tooltip" data-placement="bottom" title="<?= $transaction['memo'] ?>">
<?php if(strlen($transaction['memo']) > 30): ?>
<?= substr($memoShort, 0, 30) . '...' ?>
<?php else : ?>
<?= $transaction['memo'] ?>
<?php endif;?>
<?php endif;?>
</span>
</td>
<td> <?= $transaction['date']->nice() ?> </td>
<td><?= $this->element('printGradido', ['number' => $balance]) ?></td>

View File

@ -29,8 +29,8 @@ $this->loadHelper('Form', [
<?= $this->Form->control('amount', ['label' => __('Betrag in GDD')]) ?>
<?= $this->Form->control('memo', ['label' => __('Verwendungszweck')]) ?>
<?= $this->Form->control('email', ['label' => __('Empfänger'), 'placeholder' => 'E-Mail']) ?>
<?= $this->Form->button(__('Transaktion(n) abschließen'), ['name' => 'next', 'class' => 'btn btn-sm btn-primary']) ?>
<?= $this->Form->button(__('Weitere Transaktion erstellen'), ['name' => 'add', 'class' => 'btn btn-sm']) ?>
<?= $this->Form->button(__('Transaktion abschließen'), ['name' => 'next', 'class' => 'btn btn-sm btn-primary']) ?>
<!--<?= $this->Form->button(__('Weitere Transaktion erstellen'), ['name' => 'add', 'class' => 'btn btn-sm']) ?>-->
<?= $this->Form->end() ?>
</div>
</div>