Skip to content
Snippets Groups Projects

Pairing multicheckbox facets

Merged Ghislain Loas requested to merge pairing-multicheckbox-facets into master
Compare and
+ 361
86
Preferences
Compare changes
Files
@@ -71,6 +71,15 @@ class RechercheController extends ZendAfi_Controller_Action {
unset($params['q']);
}
if ($multifacets = $this->_extractMultifacetsPost()) {
$url = $this->newCriteresRecherches($params)
->getUrlWithMultifacetsUpdate($multifacets);
$this->_redirect($this->view->url($url, null, true),
['prependBase' => false]);
return;
}
$search_start_time = microtime(true);
$criteres_recherche = $this->newCriteresRecherches($params);
@@ -79,7 +88,6 @@ class RechercheController extends ZendAfi_Controller_Action {
$search_result = $this->moteur->lancerRecherche($criteres_recherche);
if ('json' == $this->_getParam('format', '')) {
$this->_renderJsonResult($search_result);
return;
@@ -90,12 +98,24 @@ class RechercheController extends ZendAfi_Controller_Action {
return;
}
$this->_renderHtmlResult($search_result);
$this->view->search_duration = microtime(true) - $search_start_time;
}
protected function _extractMultifacetsPost() {
if (!$this->_request->isPost())
return;
$datas = [];
foreach($this->_request->getPost() as $k => $v)
if ($facet = ZendAfi_View_Helper_Facettes::multifacetCodeFromKey($k))
$datas[$facet] = $v;
return $datas;
}
protected function _renderHtmlResult($search_result) {
$criteres_recherche = $search_result->getCriteresRecherche();
$this->getFrontController()->getRouter()->getCurrentRoute()