diff --git a/VERSIONS_HOTLINE/80427 b/VERSIONS_HOTLINE/80427 new file mode 100644 index 0000000000000000000000000000000000000000..afe89f536238c1824571ccd5bc86b30b2b7088d0 --- /dev/null +++ b/VERSIONS_HOTLINE/80427 @@ -0,0 +1 @@ + - ticket #80427 : n'affiche plus le bloc CVS lorsqu'on est connecté en superadmin \ No newline at end of file diff --git a/library/digital_resources/Cvs/View/Helper/Widget.php b/library/digital_resources/Cvs/View/Helper/Widget.php index 859a0173b1b35efdc2adbbf9c543518b305eb4ca..7008a95b7a4293d2c584e17555ce0769e915d573 100644 --- a/library/digital_resources/Cvs/View/Helper/Widget.php +++ b/library/digital_resources/Cvs/View/Helper/Widget.php @@ -23,6 +23,10 @@ class Cvs_View_Helper_Widget extends ZendAfi_View_Helper_BaseHelper { public function widget($settings, $criteria) { $config = Cvs_Config::getInstance(); + + if (!$config->isEnabled()) + return ''; + if (!$config->hasRightAccess(Class_Users::getIdentity())) return ''; diff --git a/library/digital_resources/Cvs/tests/CvsTest.php b/library/digital_resources/Cvs/tests/CvsTest.php index 5ddc1d782ea9f55883b2bf3568a03549c6e367d3..22ffc17cd190ff578983e4d4a7265a2a82e82de6 100644 --- a/library/digital_resources/Cvs/tests/CvsTest.php +++ b/library/digital_resources/Cvs/tests/CvsTest.php @@ -330,7 +330,6 @@ class CvsRecordsSearchCuissonTest extends CvsSearchWithResultTestCase { - class CvsWithRecordsSearchDelpyTest extends CvsSearchWithResultTestCase { public function setUp() { parent::setUp(); @@ -407,6 +406,37 @@ class CvsRechercheControllerSimpleActionWithCvsActivatedTest extends CvsSearchWi +class CvsRechercheControllerSimpleActionWithCvsDeactivatedTest extends CvsSearchWithResultTestCase { + public function setUp() { + parent::setUp(); + + Class_AdminVar::set('Cvs_BMKEY', ''); + + Class_Profil::getCurrentProfil() + ->setCfgModules(['recherche' => + ['resultatsimple' => ['cvs_autres_resultats' => 'Results from opac', + 'cvs_resultat_titre' => 'CVS Ressources', + 'cvs_nb_result' => '5', + 'cvs_display_position' => '1']]]); + + $this->dispatch('/recherche/simple/expressionRecherche/pomme/tri/alpha_auteur',true); + + } + + protected function _returnedXML() { + return ''; + } + + + /** @test **/ + public function pageShouldNotIncludeCvs() { + $this->assertNotXPath('//div[contains(@class,"cvs")]'); + } +} + + + + class CvsRechercheControllerSimpleActionWithCvsActivatedAndPreferencesHiddenTest extends CvsActivatedBorrowerLoggedTestCase { public function setUp() {