diff --git a/VERSIONS_HOTLINE/49679 b/VERSIONS_HOTLINE/49679 new file mode 100644 index 0000000000000000000000000000000000000000..517a1f6ad16366380de0aaf0fb3f661935dea3cd --- /dev/null +++ b/VERSIONS_HOTLINE/49679 @@ -0,0 +1 @@ + - ticket #49679 : Administration : suppression des fonctions obsolètes des statistiquess des consultation de notices \ No newline at end of file diff --git a/application/modules/admin/controllers/StatController.php b/application/modules/admin/controllers/StatController.php index adb10ff08a668af036473208e938b03c4e855d98..60ac69d23645b92315408e29b8ee856a771fd40c 100644 --- a/application/modules/admin/controllers/StatController.php +++ b/application/modules/admin/controllers/StatController.php @@ -39,19 +39,6 @@ class Admin_StatController extends ZendAfi_Controller_Action { } - public function visunoticeAction() { - $this->view->titre = $this->_('Statistiques de visualisation des notices'); - $this->view->table_stat = $this->cls_stat->getRecapVisu(); - } - - - public function palmaresvisunoticeAction() { - $this->view->titre = 'Palmarès des visualisations de notices'; - $this->view->table_stat = $this->cls_stat->getPalmaresVisu($this->_getParam('type_doc')); - $this->view->type_doc = $this->_getParam('type_doc'); - } - - public function rechercheinfructueuseAction() { $this->view->titre = $this->_('Recherches infructueuses'); $page = $this->_getParam('page', 1); diff --git a/application/modules/admin/views/scripts/stat/palmaresvisunotice.phtml b/application/modules/admin/views/scripts/stat/palmaresvisunotice.phtml deleted file mode 100644 index bd2e83f4a804d77d1ab2b03d4429489fcbb68603..0000000000000000000000000000000000000000 --- a/application/modules/admin/views/scripts/stat/palmaresvisunotice.phtml +++ /dev/null @@ -1,46 +0,0 @@ -<table> - <tr> - <td style="text-align:right">Type de document : </td> - <td style="text-align:left" width="70%"> - <?php - echo $this->ComboCodification('type_doc', - $this->type_doc, - 'onchange="window.location.replace(\''.BASE_URL.'/admin/stat/palmaresvisunotice?type_doc=\' + this.value);"'); ?> - </td> - </tr> -</table> - -<br/> -<table class="stat"> - <tr> - <th class="stat" width="1%">Rang</th> - <th class="stat" width="1%"> </th> - <th class="stat" width="50%">Titre</th> - <th class="stat" width="40%">Auteur</th> - <th class="stat" width="9%">Vue</th> - </tr> -<?php -$rang = 0; -$last_nombre = 0; -if($this->table_stat) { - foreach($this->table_stat as $notice) { - // Calcul n° de rang - if($notice["nombre"] != $last_nombre) { - $last_nombre=$notice["nombre"]; - $rang++; - } - - // Html - print('<tr>'); - print('<td class="stat_nombre" style="text-align:center"><B>'.$rang.'</b></td>'); - print('<td class="stat_libelle"><img src="'.URL_ADMIN_IMG.'supports/support_'.$notice["type_doc"].'.gif" border="0"></td>'); - print('<td class="stat_libelle">'.$notice["titre"].'</td>'); - print('<td class="stat_libelle">'.$notice["auteur"].'</td>'); - print('<td class="stat_nombre">'.$notice["nombre"].' fois</td>'); - print('</tr>'); - } -} -print('</table>'); -?> - -<br> diff --git a/application/modules/admin/views/scripts/stat/visunotice.phtml b/application/modules/admin/views/scripts/stat/visunotice.phtml deleted file mode 100644 index 8eba04fa67c7c992c0863b25e75c6b8cafaa301b..0000000000000000000000000000000000000000 --- a/application/modules/admin/views/scripts/stat/visunotice.phtml +++ /dev/null @@ -1,28 +0,0 @@ -<h2 class="stat"> -<?php echo $this->periode;?>, -<?php echo number_format($this->table_stat["total"], 0, ',', ' ');?> notices ont été visualisées -</h2> - -<script> - $(function(){$('#accordion').accordion({autoHeight:false, collapsible:true});}); -</script> - -<?php if (isset($this->table_stat)) { ?> -<h3 class="stat">Détail par années</h3> -<?php -$years = []; -foreach ($this->table_stat as $label => $datas) - if (isset($datas['total'])) - $years[$label] = $datas['total']; -echo $this->blocStats('Année', $years);?> - -<h3 class="stat">Détail par mois</h3> -<div id="accordion"> -<?php foreach ($this->table_stat as $label => $datas) { -if (!isset($datas['mois'])) continue;?> -<h4><?php echo $label;?></h4> -<?php echo $this->blocStats('Mois', $datas['mois']);?> -<?php } ?> -</div> -<?php } ?> -<br> diff --git a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php index 34ef100725c38d200e2370a09a3298cf64628f3f..c4743786dc71b97c043848934af970281f14706f 100644 --- a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php +++ b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php @@ -110,9 +110,7 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base return $this ->renderBloc($this->_('Statistiques'), [['piwik_stats', $this->_('Piwik'), '/admin/stat/piwik'], - ['failed_searches', $this->_('Recherches infructueuses'), '/admin/stat/rechercheinfructueuse'], - ['record_views', $this->_('Visualisations de notices'), '/admin/stat/visunotice'], - ['top_record_views', $this->_('Palmarès des visualisations'), '/admin/stat/palmaresvisunotice'] + ['failed_searches', $this->_('Recherches infructueuses'), '/admin/stat/rechercheinfructueuse'] ]); } diff --git a/tests/application/modules/admin/controllers/StatControllerTest.php b/tests/application/modules/admin/controllers/StatControllerTest.php index ea127eaf38fad714a5e9dbd3c25fac36f31d46f9..f680b9f0550e9a5b708a6be2bb5dbb1162ba426b 100644 --- a/tests/application/modules/admin/controllers/StatControllerTest.php +++ b/tests/application/modules/admin/controllers/StatControllerTest.php @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * along with BOKEH; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ require_once 'AdminAbstractControllerTestCase.php'; @@ -31,131 +31,4 @@ class Admin_StatControllerRecherchesInfructueusesTest extends Admin_AbstractCont $this->assertXPathContentContains('//h1', 'Recherches infructueuses'); } } - - -class Admin_StatControllerVisunoticeTest extends Admin_AbstractControllerTestCase{ - public function setUp() { - parent::setUp(); - $this->sql = $this->mock() - ->whenCalled('fetchAll') - ->with('Select annee, sum(nb_visu) from stats_notices group by 1 order by annee desc', false) - ->answers([['annee' => '2000', 'sum(nb_visu)' => 6000],]) - - ->whenCalled('fetchAll') - ->with('Select annee, mois, nb_visu as cnt from stats_notices order by annee desc, mois desc', - false) - ->answers([['annee' => '2000', 'mois' => 1, 'cnt' => 42],]) - - ->whenCalled('fetchOne') - ->with('select min(annee) from stats_notices') - ->answers('2000') - - ->whenCalled('fetchOne') - ->with("select min(mois) from stats_notices where annee=2000") - ->answers('1') - - ->whenCalled('fetchOne') - ->answers('1'); - - - Zend_Registry::set('sql', $this->sql); - - $this->dispatch('/admin/stat/visunotice', true); - } - - - /** @test */ - public function titreShouldBeVisualisationNotice() { - $this->assertXPathContentContains('//h1', 'visualisation des notices'); - } - - - /** @test */ - public function shouldHaveYearDetails() { - $this->assertXPathContentContains('//h3', 'Détail par années'); - } - - - /** @test */ - public function shouldHaveYear2000Label() { - $this->assertXPathContentContains('//td', '2000'); - } - - - /** @test */ - public function shouldHaveYear2000Detail() { - $this->assertXPathContentContains('//td', '6000'); - } - - - /** @test */ - public function shouldHaveYearsGraph() { - $this->assertXPath('//img[contains(@src, "chl=2000")]'); - } - - - /** @test */ - public function shouldHaveMonthDetails() { - $this->assertXPathContentContains('//h3', 'Détail par mois'); - } - - - /** @test */ - public function shouldHaveMonth1DetailLabel() { - $this->assertXPathContentContains('//td', 'janvier'); - } - - - /** @test */ - public function shouldHaveMonth1DetailCount() { - $this->assertXPathContentContains('//td', '42'); - } - - /** @test */ - public function shouldHaveMonthsGraph() { - $this->assertXPath('//img[contains(@src, "janvier")]', - $this->_response->getBody()); - } -} - - -class Admin_StatControllerPalmaresVisunoticeTest extends Admin_AbstractControllerTestCase{ - public function setUp() { - parent::setUp(); - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_TypeDoc') - ->whenCalled('findUsedTypeDocIds') - ->answers([]); - - $this->fixture('Class_Notice', ['id' => 1, - 'nb_visu' => 600, - 'titre_principal' => 'Captain Harlock']); - - $this->dispatch('/admin/stat/palmaresvisunotice', true); - } - - - /** @test */ - public function titleShouldBePalmares() { - $this->assertXPathContentContains('//h1', 'Palmarès des visualisations de notices'); - } - - - /** @test */ - public function docTypeSelectorShouldBePresent() { - $this->assertXPath('//select[@id="select_type_doc"]'); - } - - - /** @test */ - public function harlockShouldBeInPalmares() { - $this->assertXPathContentContains('//td', 'Captain Harlock'); - } - - - /** @test */ - public function harlockShouldHaveBeenViewed600Times() { - $this->assertXPathContentContains('//td', '600', $this->_response->getBody()); - } -} - ?> \ No newline at end of file diff --git a/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php b/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php index 1711b85c946ffe95724f72f84d0e24e156c50b2a..8f46e649c2b0585d9529e21f011b3ec49e53ad25 100644 --- a/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php +++ b/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php @@ -228,8 +228,6 @@ Trait MenuGaucheAdminRolesDefinition { 'profil/genres', 'index/update-skin', 'stat/rechercheinfructueuse', - 'stat/visunotice', - 'stat/palmaresvisunotice', 'zone', 'bib', 'users', @@ -282,8 +280,6 @@ Trait MenuGaucheAdminRolesDefinition { 'profil/genres', 'index/update-skin', 'stat/rechercheinfructueuse', - 'stat/visunotice', - 'stat/palmaresvisunotice', 'zone', 'bib', 'users', @@ -309,8 +305,6 @@ Trait MenuGaucheAdminRolesDefinition { 'modo/membreview', 'newsletter', 'stat/rechercheinfructueuse', - 'stat/visunotice', - 'stat/palmaresvisunotice', ] ], [ZendAfi_Acl_AdminControllerRoles::ADMIN_BIB, @@ -335,8 +329,6 @@ Trait MenuGaucheAdminRolesDefinition { 'print/index', 'profil/genres', 'stat/rechercheinfructueuse', - 'stat/visunotice', - 'stat/palmaresvisunotice', 'bib', 'users', 'usergroup' @@ -350,8 +342,6 @@ Trait MenuGaucheAdminRolesDefinition { 'modo/membreview', 'newsletter', 'stat/rechercheinfructueuse', - 'stat/visunotice', - 'stat/palmaresvisunotice', ] ] ]; }