Skip to content
Snippets Groups Projects
Commit 301861e5 authored by llaffont's avatar llaffont
Browse files

Affichage de la date de création du formulaire posté

parent fb630e73
Branches
Tags
No related merge requests found
......@@ -6,8 +6,29 @@ $data_names = Class_Formulaire::mergeDataNames($this->formulaires);
echo $this->tagModelTable(
$this->formulaires,
array_merge([$this->_('Posté par'), $this->_('Bibliothèque')], $data_names),
array_merge(['compte', 'libelle_bib'], $data_names),
[['action' => 'delete-formulaire', 'content' => $this->boutonIco('type=del')]],
'formulaires');
array_merge([$this->_('Date'), $this->_('Posté par'), $this->_('Bibliothèque')], $data_names),
array_merge(
[
'date_creation',
'compte',
'libelle_bib'
],
$data_names
),
[ ['action' => 'delete-formulaire', 'content' => $this->boutonIco('type=del')] ],
'formulaires',
null,
[
'date_creation' => function($model) {
return $this->humanDate($model->getDateCreation(), 'dd/MM/yyyy');
}
]
);
?>
\ No newline at end of file
......@@ -85,4 +85,9 @@ class Class_Formulaire extends Storm_Model_Abstract {
return '';
}
public function getShortDateCreation() {
return explode(' ', $this->getDateCreation())[0];
}
}
......@@ -36,10 +36,12 @@ abstract class ModoControllerFormulaireForArticleTestCase extends Admin_Abstract
->answers([
Class_Formulaire::newInstanceWithId(3, ['data' => serialize(['nom' => 'Tinguette',
'prenom' => 'Quentine']),
'date_creation' => '2012-12-05 12:00:23',
'article' => $article]),
Class_Formulaire::newInstanceWithId(5, ['data' => serialize(['nom' => 'Bougie',
'Prenom' => 'Mireille']),
'date_creation' => '2012-12-06 10:00:01',
'article' => $article,
'user' => Class_Users::newInstanceWithId(34,
[
......@@ -50,6 +52,7 @@ abstract class ModoControllerFormulaireForArticleTestCase extends Admin_Abstract
Class_Formulaire::newInstanceWithId(6, ['data' => serialize(['name' => 'Lefort',
'prenom' => 'Nono',
'age' => 12]),
'date_creation' => '2012-11-06 17:00:01',
'article' => $article])
]);
}
......@@ -108,6 +111,12 @@ class ModoControllerFormulaireForArticleListTest extends ModoControllerFormulair
}
/** @test */
public function mireilleRowShouldContainsDate06_12_2012 () {
$this->assertXPathContentContains('//tr[2]//td', '06/12/2012', $this->_response->getBody());
}
/** @test */
public function aTDShouldContainsActionToDeleteFormulaireMireille() {
$this->assertXPath('//tr[2]//td/a[contains(@href, "admin/modo/delete-formulaire/id_article/12/id/5")]');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment