From 3a551dc8a0001e64203fa7fa58d464b73e3b720d Mon Sep 17 00:00:00 2001 From: llaffont <llaffont@git-test.afi-sa.fr> Date: Sat, 1 Jun 2013 13:02:32 +0000 Subject: [PATCH] Correction tests + rendu historique recherche --- .../opac/controllers/AuthController.php | 2 +- .../opac/controllers/CasServerController.php | 3 +-- .../opac/controllers/RechercheController.php | 2 +- library/Class/Systeme/ModulesAppli.php | 5 +++-- .../ZendAfi/View/Helper/TagRechercheSimple.php | 2 +- public/opac/css/global.css | 18 ++++++++++++++++++ .../controllers/RechercheControllerTest.php | 4 ++-- .../View/Helper/HistoriqueRechercheTest.php | 4 ++-- 8 files changed, 29 insertions(+), 11 deletions(-) diff --git a/application/modules/opac/controllers/AuthController.php b/application/modules/opac/controllers/AuthController.php index fe65f7c06e1..7185667399d 100644 --- a/application/modules/opac/controllers/AuthController.php +++ b/application/modules/opac/controllers/AuthController.php @@ -43,7 +43,7 @@ class AuthController extends Zend_Controller_Action $f = new Zend_Filter_StripTags(); $username = $f->filter($this->_request->getPost('username')); $password = $f->filter($this->_request->getPost('password')); - xdebug_break(); + if (empty($username)) return $this->view->_('Entrez votre identifiant S.V.P.'); diff --git a/application/modules/opac/controllers/CasServerController.php b/application/modules/opac/controllers/CasServerController.php index a099cbd7d71..5a737601036 100644 --- a/application/modules/opac/controllers/CasServerController.php +++ b/application/modules/opac/controllers/CasServerController.php @@ -36,7 +36,6 @@ class CasServerController extends Zend_Controller_Action { } function loginAction() { - xdebug_break(); $this->values=$this->_request->getParams(); $service = $this->_request->getParam('service'); @@ -134,7 +133,7 @@ class CasServerController extends Zend_Controller_Action { function validateAction() { $service=$this->_request->getParam('service'); $ticket=$this->_request->getParam('ticket'); - xdebug_break(); + if (strlen($ticket)<1 || strlen($service)<1) { return $this->returnFailureTicketResponse('INVALID_REQUEST'); } diff --git a/application/modules/opac/controllers/RechercheController.php b/application/modules/opac/controllers/RechercheController.php index b98c68254f4..f0f6a151a24 100644 --- a/application/modules/opac/controllers/RechercheController.php +++ b/application/modules/opac/controllers/RechercheController.php @@ -86,7 +86,7 @@ class RechercheController extends Zend_Controller_Action public function simpleAction() { if ($this->view->statut == "saisie") { - $this->_forward('saisie'); + $this->_redirect('opac/recherche/saisie'); return; } diff --git a/library/Class/Systeme/ModulesAppli.php b/library/Class/Systeme/ModulesAppli.php index 640812083d9..f7ade2d8ee1 100644 --- a/library/Class/Systeme/ModulesAppli.php +++ b/library/Class/Systeme/ModulesAppli.php @@ -66,7 +66,7 @@ class Class_Systeme_ModulesAppli extends Class_Systeme_ModulesAbstract { 'resultat' => array('libelle' => 'Résultat', 'popup_width' => 710, 'popup_height' => 620), 'resultatsimple' => array('libelle' => 'Résultat', 'titre' => 'test', 'popup_width' => 710, 'popup_height' => 620), 'viewnotice' => array('libelle' => 'Notice', 'popup_width' => 700, 'popup_height' => 720), - 'saisie' => array('libelle' => 'Nouvelle recherchere', 'popup_width' => 500, 'popup_height' => 300)), + 'saisie' => array('libelle' => 'Nouvelle recherchere', 'popup_width' => 800, 'popup_height' => 400)), 'noticeajax' => array( '*' => array('libelle' => 'Notice', 'popup_width' => 500, 'popup_height' => 300), @@ -271,7 +271,8 @@ class Class_Systeme_ModulesAppli extends Class_Systeme_ModulesAbstract { case "saisie"; $ret = array_merge((new Class_Systeme_ModulesAccueil_RechercheSimple())->getDefaultValues(), - ['type_doc' => 1]); + ['select_doc' => 1, + 'largeur' => 250]); break; } diff --git a/library/ZendAfi/View/Helper/TagRechercheSimple.php b/library/ZendAfi/View/Helper/TagRechercheSimple.php index 587305337c5..684c27e803a 100644 --- a/library/ZendAfi/View/Helper/TagRechercheSimple.php +++ b/library/ZendAfi/View/Helper/TagRechercheSimple.php @@ -39,7 +39,7 @@ class ZendAfi_View_Helper_TagRechercheSimple extends Zend_View_Helper_HtmlElemen $arg_filtre = ''; if(array_isset("type_doc", $this->preferences)) $arg_filtre="?facette=T".$this->preferences["type_doc"]; - $this->contenu.='<form name="form" action="'.BASE_URL.'/opac/recherche/simple'.$arg_filtre.'" method="get" class="rechSimpleForm">'; + $this->contenu = '<form name="form" action="'.BASE_URL.'/opac/recherche/simple'.$arg_filtre.'" method="get" class="rechSimpleForm">'; $this->contenu.= '<div>'; if (isset($this->preferences["type_doc"])) $this->contenu.= '<input type="hidden" name="type_doc" value="'.$this->preferences["type_doc"].'" />'; diff --git a/public/opac/css/global.css b/public/opac/css/global.css index 6ce11d1e9f4..2c7b722a6b0 100644 --- a/public/opac/css/global.css +++ b/public/opac/css/global.css @@ -1719,3 +1719,21 @@ button.vodeclic_link + img { } + + +/** historique recherche */ +.recherche_saisie .criteres_recherche ul { + display: table; +} + +.recherche_saisie .criteres_recherche ul li { + display: table-row; +} + +.recherche_saisie .criteres_recherche ul li ul{ + display: table-cell; +} + +.recherche_saisie .criteres_recherche ul li ul li { + display: block +} \ No newline at end of file diff --git a/tests/application/modules/opac/controllers/RechercheControllerTest.php b/tests/application/modules/opac/controllers/RechercheControllerTest.php index 808204038db..9f74d8055e6 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerTest.php @@ -1050,9 +1050,9 @@ class RechercheControllerWithPanierTest extends AbstractControllerTestCase { class RechercheControllerActionSimpleWithResetTest extends AbstractControllerTestCase { /** @test */ - public function responseShouldDisplayActionSaisie() { + public function responseShouldRedirectToActionSaisie() { $this->dispatch('/recherche/simple/statut/reset', true); - $this->assertXPath('//input[@name="expressionRecherche"]'); + $this->assertRedirectTo('/opac/recherche/saisie'); } } diff --git a/tests/library/ZendAfi/View/Helper/HistoriqueRechercheTest.php b/tests/library/ZendAfi/View/Helper/HistoriqueRechercheTest.php index 521b7d8dbfc..e1ad2a8068d 100644 --- a/tests/library/ZendAfi/View/Helper/HistoriqueRechercheTest.php +++ b/tests/library/ZendAfi/View/Helper/HistoriqueRechercheTest.php @@ -57,13 +57,13 @@ class ZendAfi_View_Helper_HistoriqueRechercheWith2CriteresTest extends ViewHelpe /** @test */ public function URLRechercheSimpleShouldBeDisplay(){ $this->assertXPath($this->_helper->historiqueRecherche(), - '//tr[contains(@onclick, "/recherche/simple/expressionRecherche/Millenium")]'); + '//a[contains(@href, "/recherche/simple/expressionRecherche/Millenium")]'); } /** @test */ public function URLRechercheAvanceShouldBeDisplay(){ $this->assertXPath($this->_helper->historiqueRecherche(), - '//tr[contains(@onclick, "/recherche/simple/rech_titres/Les+hommes+qui+n%27aimaient+pas+les+femmes/rech_auteurs/Larsson")]',$this->_helper->historiqueRecherche()); + '//a[contains(@href, "/recherche/simple/rech_titres/Les+hommes+qui+n%27aimaient+pas+les+femmes/rech_auteurs/Larsson")]',$this->_helper->historiqueRecherche()); } } -- GitLab