diff --git a/app/controller/perso.php b/app/controller/perso.php index ca2e0799c11ddf5310237410162c80d2d2ad3f55..8d16a00786abfe8e8bd70596c868c1272077ab93 100644 --- a/app/controller/perso.php +++ b/app/controller/perso.php @@ -30,6 +30,7 @@ class Perso extends Controller $this->get_contreparties($f3); $this->get_dons($f3); $this->get_recurrents($f3); + $this->compute_history($f3); if ($f3->exists('GET.validate')) { $f3->set('modal_counterparts', '1'); $f3->clear('GET.validate'); @@ -84,6 +85,16 @@ class Perso extends Controller $f3->set('dons_recurrents', $dons); } + public function compute_history($f3) + { + $history = array(); + $history = array_merge($f3->get('dons'), $f3->get('dons_recurrents')); + usort($history, function ($a, $b) { + return strtotime($a['datec']) - strtotime($b['datec']); + }); + $f3->set('historique', $history); + } + public function login($f3, $args) { $f3->set('form_visible', 'login'); diff --git a/app/view/user/perso.html b/app/view/user/perso.html index 496af242f516dec3eda739a1aad066e6b31aa465..68c1e2db1bc09cf38ddd3187f71bd0edcac52299 100644 --- a/app/view/user/perso.html +++ b/app/view/user/perso.html @@ -141,7 +141,7 @@