Skip to content
Snippets Groups Projects

Hotline master

Merged Patrick Barroca requested to merge hotline-master into master
Compare and
11 files
+ 161
39
Preferences
Compare changes
Files
11
@@ -253,31 +253,33 @@ class Class_CriteresRecherche {
public function getFiltres() {
$filtres = [ 'G' => $this->selectionToArray('G', $this->getGenre()),
];
if (!$this->isRecherchePanier() && !$this->isRechercheCatalogueEmpty() && $this->_profil) {
$filtres = array_merge($filtres, [
'T' => $this->selectionToArray('T', $this->_profil->getSelTypeDoc()),
'Y' => $this->selectionToArray('Y', $this->_profil->getSelAnnexe()),
'S' => $this->selectionToArray('S', $this->_profil->getSelSection()),
]);
$filtres = ['G' => $this->selectionToArray('G', $this->getGenre())];
if (!$this->isRecherchePanier()
&& !$this->isRechercheCatalogueEmpty()
&& $this->_profil) {
$filtres = array_merge($filtres,
['T' => $this->selectionToArray('T', $this->_profil->getSelTypeDoc()),
'Y' => $this->selectionToArray('Y', $this->_profil->getSelAnnexe()),
'S' => $this->selectionToArray('S', $this->_profil->getSelSection()),
]);
}
$filtres_array = array_filter(explode('-',$this->getParam('filtres',null)));
$filtres_array = array_filter(explode('-', $this->getParam('filtres', null)));
foreach ($filtres_array as $filtre_str) {
$filtres[]= array_filter(explode(';',$filtre_str),
[$this, 'validCodeOrNull']);
}
if (($codes = array_filter(explode(';',$filtre_str), [$this, 'validCodeOrNull']))
&& ($key = Class_Notice_Facette::extractCodeRubrique($codes[0])))
$filtres[$key] = $codes;
}
if ($bibs=$this->getBibs()) {
if ($bibs = $this->getBibs()) {
$bib_ids=[];
$bibs_array=explode(',',$bibs);
$bibs_array = explode(',',$bibs);
foreach ($bibs_array as $bib) {
$bib_ids[]= 'B'.$bib;
$bib_ids[] = 'B'.$bib;
}
$filtres['B']=$bib_ids;
$filtres['B'] = $bib_ids;
}
if ($geo_zone=$this->getGeoZone()) {
@@ -294,7 +296,7 @@ class Class_CriteresRecherche {
$filtres['B'] = ['B'.$bib->getId()];
}
return array_filter($filtres);
return array_filter($filtres);
}
@@ -786,6 +788,9 @@ class Class_CriteresRecherche {
public function getUrlRemoveMultiFacet($code) {
$multifacets = [];
foreach($this->getMultiFacets() as $facet) {
if (!$facet)
continue;
$model = new Class_Notice_Facette($facet);
if ($model->getRubrique()->getCode() != $code)
$multifacets[] = $facet;