init
[garradin.git] / www / admin / compta / exercices / journal.php
1 <?php
2 namespace Garradin;
3
4 require_once __DIR__ . '/../_inc.php';
5
6 $exercices = new Compta_Exercices;
7
8 $exercice = $exercices->get((int)utils::get('id'));
9
10 if (!$exercice)
11 {
12 throw new UserException('Exercice inconnu.');
13 }
14
15 $liste_comptes = $comptes->getListAll();
16
17 function get_nom_compte($compte)
18 {
19 if (is_null($compte))
20 return '';
21
22 global $liste_comptes;
23 return $liste_comptes[$compte];
24 }
25
26 $tpl->register_modifier('get_nom_compte', 'Garradin\get_nom_compte');
27 $tpl->assign('journal', $exercices->getJournal($exercice['id']));
28
29 $tpl->assign('cloture', $exercice['cloture'] ? $exercice['fin'] : time());
30 $tpl->assign('exercice', $exercice);
31
32 $tpl->display('admin/compta/exercices/journal.tpl');
33
34 ?>