Skip to content
Snippets Groups Projects
Commit 905ce605 authored by llaffont's avatar llaffont
Browse files

Correction redirection sur la saisie de la recherche si statut=reset

parent eb4cc6da
Branches
Tags 6.0.3
No related merge requests found
......@@ -33,7 +33,6 @@ class RechercheController extends Zend_Controller_Action
//------------------------------------------------------------------------------------------------------
function init() {
// Instanciations
$profil = Class_Profil::getCurrentProfil();
$this->moteur=Class_MoteurRecherche::getInstance();
$this->view->resultat=array();
......@@ -44,27 +43,10 @@ class RechercheController extends Zend_Controller_Action
// Statut de la recherche
$this->view->statut = $this->_getParam("statut");
if($this->view->statut == "reset")
{
if($this->view->statut == "reset") {
$this->view->statut ="saisie";
}
/*
if (array_key_exists("id_bibs", $_SESSION["selection_bib"])) {
$bibs=explode(",",$_SESSION["selection_bib"]["id_bibs"]);
if (!array_key_exists("recherche", $_SESSION))
$_SESSION["recherche"] = array("selection" => array("selection_bib" => array()),
"mode" => "",
"retour_notice" => "");
$_SESSION["recherche"]["selection"]["selection_bib"] = '';
foreach($bibs as $bib)
$_SESSION["recherche"]["selection"]["selection_bib"] .=" B".$bib;
}*/
// Selection de types de docs lies au profil
//if($profil->getSelTypeDoc() and !$_SESSION["recherche"]["selection"]["type_doc"]) $_SESSION["recherche"]["selection"]["type_doc"]=str_replace(";",",",$profil->getSelTypeDoc());
$this->view->url_retour=BASE_URL."/opac/recherche/simple/";
$this->view->url_facette=$this->view->url_retour;
// Préférences
......@@ -76,8 +58,8 @@ class RechercheController extends Zend_Controller_Action
public function _getListNotices($req) {
if (!$req)
return ['statut' => 'erreur',
'erreur' => 'Aucune notice trouvée',
'nb_mots' => 1];
'erreur' => 'Aucune notice trouvée',
'nb_mots' => 1];
return Class_Notice::findAllByRequeteRecherche($req,$this->preferences["liste_nb_par_page"],$this->_getParam('page',1));
}
......@@ -99,13 +81,15 @@ class RechercheController extends Zend_Controller_Action
public function saisieAction() {
$this->view->expressionRecherche = $this->_request->getParam('expressionRecherche');
return;
}
public function simpleAction() {
if ($this->view->statut == "saisie")
if ($this->view->statut == "saisie") {
$this->_forward('saisie');
return;
}
$params = $this->_request->getParams();
if (isset($params['q'])) {
......@@ -237,15 +221,7 @@ class RechercheController extends Zend_Controller_Action
$this->view->notice = $notice;
$this->view->preferences = $this->preferences;
/*
if (trim($this->_getParam('expressionRecherche','')))
$this->view->url_retour=BASE_URL.'/recherche/simple/'.implode('/',$this->getCleanSelection());
else if ($this->getCleanSelection()) {
$this->view->url_retour=BASE_URL.'/recherche/avancee/'.implode('/',$this->getCleanSelection());
}
else if (array_isset('retour_liste', $_SESSION["recherche"]))
$this->view->url_retour = $_SESSION["recherche"]["retour_liste"];
*/
$criteres_recherche = new Class_CriteresRecherche();
$criteres_recherche->setParams($this->_request->getParams());
$this->view->criteres_recherche=$criteres_recherche;
......
<?php
if($this->statut=="saisie")
{
echo $this->render("recherche/simple.phtml");
}
else
{
echo $this->render("recherche/resultatRecherche.phtml" );
}
echo $this->render("recherche/resultatRecherche.phtml" );
?>
\ No newline at end of file
......@@ -1015,4 +1015,15 @@ class RechercheControllerWithPanierTest extends AbstractControllerTestCase {
class RechercheControllerActionSimpleWithResetTest extends AbstractControllerTestCase {
/** @test */
public function responseShouldDisplayActionSaisie() {
$this->dispatch('/recherche/simple/statut/reset', true);
$this->assertXPath('//input[@name="expressionRecherche"]');
}
}
?>
\ No newline at end of file
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