Skip to content
Snippets Groups Projects
Commit 0f1e642f authored by Patrick Barroca's avatar Patrick Barroca
Browse files

rel #40411 : fix RT

parent 5e2a9c3c
Branches
Tags
3 merge requests!1659Master,!1636Dev#40411 story 6 pouvoir rechercher dans l annuaire demande fille,!1625Dev#40411 story 6 pouvoir rechercher dans l annuaire demande fille
......@@ -107,28 +107,24 @@ class ZendAfi_View_Helper_Accueil_Library extends ZendAfi_View_Helper_Accueil_Ba
protected function _filterByTerms($model, $terms) {
$terms = strtolower(urldecode($terms));
$terms = urldecode($terms);
$terms = explode(' ', $terms);
$terms = array_filter($terms);
$result = true;
foreach($terms as $term)
$result = $result && $this->_filterByterm($model, $term);
if (!$this->_filterByterm($model, $term))
return false;
return $result;
return true;
}
protected function _filterByterm($model, $term) {
$result = false;
foreach(['libelle',
'ville',
'adresse',
'cp'] as $field) {
$getter = 'get' . ucfirst($field) . '()';
$result = $result || (false !== strpos(strtolower($model->$getter()), $term));
}
return $result;
foreach(['libelle', 'ville', 'adresse', 'cp'] as $field)
if (false !== strpos(strtolower($model->callGetterByAttributeName($field)), strtolower($term)))
return true;
return false;
}
......
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