diff --git a/VERSIONS_WIP/146672 b/VERSIONS_WIP/146672 new file mode 100644 index 0000000000000000000000000000000000000000..402b48b72fda3706157c052dfa98a6fe3001ca10 --- /dev/null +++ b/VERSIONS_WIP/146672 @@ -0,0 +1 @@ + - ticket #146672 : Rapport: Bokeh envoie le thème utilisé dans le profil de la page d'accueil \ No newline at end of file diff --git a/library/Class/Systeme/Report/Portal.php b/library/Class/Systeme/Report/Portal.php index f4974a0a293071f864f20651c718ead175c6725d..60abcc6557cc7f81c074953c2d9de340b6c7a0a0 100644 --- a/library/Class/Systeme/Report/Portal.php +++ b/library/Class/Systeme/Report/Portal.php @@ -35,6 +35,7 @@ class Class_Systeme_Report_Portal extends Class_Systeme_Report_Abstract { $visitor->visitData('url', $this->_('URL principale'), Class_Url::absolute('', null, true)); $visitor->visitData('ip', $this->_('IP publique'), $this->_getIp()); $visitor->visitData('label', $this->_('Libellé principal'), Class_Profil::getPortail()->getLibelle()); + $visitor->visitData('template', $this->_('Thème'), $this->_template()->getId()); $visitor->visitDataArray('skins', $this->_('Thèmes utilisés'), $this->_profilSkins()); $visitor->visitDataArray('boxes', $this->_('Boites utilisées'), $this->_profilBoxes()); $visitor->visitDataArray('tags', $this->_('Tags'), $this->_fetchTags()); @@ -64,6 +65,11 @@ class Class_Systeme_Report_Portal extends Class_Systeme_Report_Abstract { } + protected function _template() { + return (new Class_Template_Loader())->findFromProfile(Class_Profil::getPortail()->getId()); + } + + protected function _profilBoxes() { $list = []; foreach (Class_Profil::getAllModules() as $modules) diff --git a/tests/library/ZendAfi/View/Helper/Status/HtmlTest.php b/tests/library/ZendAfi/View/Helper/Status/HtmlTest.php index 8c7b7f6fed65a7592ce95a015730a6b2de07e86f..b8643627ec93f3ec0153d2c524598e65d80d4da6 100644 --- a/tests/library/ZendAfi/View/Helper/Status/HtmlTest.php +++ b/tests/library/ZendAfi/View/Helper/Status/HtmlTest.php @@ -98,6 +98,14 @@ class ZendAfi_View_Helper_Status_HtmlTest extends ZendAfi_View_Helper_Status_Tes } + /** @test */ + public function templateShouldBeHistoric() { + $this->assertXPathContentContains($this->_html, + '//dd[preceding-sibling::dt[text()="Thème"]]', + 'HISTORIC'); + } + + /** @test */ public function boxesListShouldBeSearchAndLogin() { $this->assertXPathContentContains($this->_html, @@ -282,4 +290,4 @@ class ZendAfi_View_Helper_Status_HtmlTest extends ZendAfi_View_Helper_Status_Tes '//dl/dd[preceding-sibling::dt[contains(text(), "Rapport généré")]]', '12'); } -} \ No newline at end of file +} diff --git a/tests/library/ZendAfi/View/Helper/Status/JsonTest.php b/tests/library/ZendAfi/View/Helper/Status/JsonTest.php index 4dac74780bbb107cc7ff9daa0dd505cd5dc97604..89b1a7167903e58765c107a7cb09ce45ce114f7f 100644 --- a/tests/library/ZendAfi/View/Helper/Status/JsonTest.php +++ b/tests/library/ZendAfi/View/Helper/Status/JsonTest.php @@ -96,6 +96,12 @@ class ZendAfi_View_Helper_Status_JsonTest extends ZendAfi_View_Helper_Status_Tes } + /** @test */ + public function portalTemplateShouldContainsHistoric() { + $this->assertEquals('HISTORIC', $this->_report['portal']['template']); + } + + /** @test */ public function dataIntegrationsShouldContainAlertIntegrationLate() { $this->assertEquals(['type' => 'integration_late',