Skip to content
Snippets Groups Projects
Commit 34475593 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

version 7.5.37

Merge remote-tracking branch 'refs/remotes/afi/stable' into afi-master

# Conflicts:
#	VERSIONS
#	library/startup.php
#	tests/library/Class/MoteurRecherche/MoteurRechercheFacettesTest.php
#	tests/library/Class/MoteurRechercheTest.php
parents 27635463 ef1786bb
Branches
Tags 7.5.37
1 merge request!1797Master
18/07/2016 - v7.5.37
- ticket #44613 : Résultat de recherche : possibilité de limiter le nombre de résultats maximum
- ticket #44519 : Fiche bibliothèque, les articles utilisent le même rendu que dans les boites articles (avec les métadonnées)
- ticket #44529 : Ajout d'une carte interactive dans la boite bibliothèque
- ticket #45078 : Correction d'une faille de sécurité type injection SQL
- ticket #45204 : Éditeur de carrousel dans les articles: ajout de l'icône manquante "placeholder.png"
- ticket #45245 : Modification des domaines, champs "Tags utilisateur": correction de la recherche
07/07/2016 - v7.5.36
- ticket #45291 : SIGB Pergame : correction de la configuration base de données dans le service temps réel
......
- ticket #44519 : Fiche bibliothèque, les articles utilisent le même rendu que dans les boites articles (avec les métadonnées)
\ No newline at end of file
- ticket #44529 : Ajout d'une carte interactive dans la boite bibliothèque
\ No newline at end of file
- ticket #44613 : Résultat de recherche : possibilité de limiter le nombre de résultats maximum
\ No newline at end of file
ckeditor/plugins/slideshow/icons/placeholder.png

597 B

......@@ -177,9 +177,14 @@ class Class_CriteresRecherche {
}
public function filterLetterCode($data) {
return preg_match('/[a-zA-Z][0-9]+/', trim($data));
}
public function getFacettes() {
$facettes = explode('-', $this->getParam('facettes', ''));
$facettes []= $this->getParam('facette', '');
$facettes []= $this->getParam('facette', '');
if ($this->_profil && ($selection_bib = $this->_profil->getIdSite()))
$facettes []= 'B'.$selection_bib;
......@@ -235,7 +240,8 @@ class Class_CriteresRecherche {
$filtres_array = array_filter(explode('-',$this->getParam('filtres',null)));
foreach ($filtres_array as $filtre_str) {
$filtres[]= array_filter(explode(';',$filtre_str));
$filtres[]= array_filter(explode(';',$filtre_str),
[$this, 'validCodeOrNull']);
}
if ($bibs=$this->getBibs()) {
......@@ -268,7 +274,8 @@ class Class_CriteresRecherche {
public function selectionToArray($letter, $str) {
if (!$str)
return null;
$items = array_filter(explode(';',str_replace(' ','',$str)));
$items = array_filter(explode(';',str_replace(' ','',$str)),
[$this, 'validCodeOrNull']);
foreach ($items as $key => $item) {
$items[$key] = $letter.$item;
}
......@@ -289,7 +296,10 @@ class Class_CriteresRecherche {
public function getTypeDoc() {
return $this->getParam('type_doc', 0);
return implode(',',
array_filter(explode(',',
$this->getParam('type_doc', 0)),
'is_numeric'));
}
......@@ -443,13 +453,13 @@ class Class_CriteresRecherche {
$visitor->visitTextInput($name, $operateur, $type_recherche, $value,$this->getPertinence());
}
if ($type_doc = $this->getParam('type_doc'))
if ($type_doc = $this->getTypeDoc())
$visitor->visitTypeDoc($type_doc);
if ($section = $this->getParam('section'))
if ($section = $this->getSection())
$visitor->visitSection($section);
if ($annexe = $this->getParam('annexe'))
if ($annexe = $this->getAnnexe())
$visitor->visitAnnexe($annexe);
$visitor->visitDigitalLib($this->getParam('digital_lib'));
......@@ -508,7 +518,14 @@ class Class_CriteresRecherche {
public function getAnnexe() {
return $this->getParam('annexe', null);
return $this->validCodeOrNull($this->getParam('annexe', null));
}
public function validCodeOrNull($data) {
return preg_match('/^[a-z\sA-Z0-9]+$/', $data)
? $data
: null;
}
......
......@@ -70,7 +70,7 @@ class Class_TagNoticeLoader extends Storm_Model_Loader {
}
protected function _conditionOfType($type, $term) {
protected function _conditionOfType($term, $type) {
if (static::SUGGEST_STARTS_WITH == $type)
return "like '" . $term . "%'";
......
......@@ -65,7 +65,7 @@ function defineConstant($name, $value) {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','7.5');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.36');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.37');
defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');
......
......@@ -28,27 +28,32 @@ class AjaxControllerSuggestTest extends AbstractControllerTestCase {
->mock()
->whenCalled('fetchAll')
->with("select id_auteur,libelle from codif_auteur where formes like'1%' order by FORMES limit 100", false)
->answers([['id_auteur' => 12999, 'libelle' => 'André Gosciny']])
->answers([ ['id_auteur' => 12999, 'libelle' => 'André Gosciny']])
->whenCalled('fetchAll')
->with("select id_auteur,libelle from codif_auteur where formes like'L%' order by FORMES limit 100", false)
->answers([['id_auteur' => 12999, 'libelle' => 'André Gosciny']])
->answers([ ['id_auteur' => 12999, 'libelle' => 'André Gosciny']])
->whenCalled('fetchAll')
->with("select id_matiere,libelle from codif_matiere where code_alpha like 'L%' order by code_alpha limit 100", true)
->answers([[999, 'Testing test']])
->answers([ [999, 'Testing test']])
->whenCalled('fetchAll')
->with("select id_interet,libelle from codif_interet where code_alpha like 'L%' order by code_alpha limit 100", true)
->answers([[777, 'Cinéma']])
->answers([ [777, 'Cinéma']])
->whenCalled('fetchAll')
->with("select id_dewey,libelle from codif_dewey where id_dewey like'%' order by id_dewey limit 100", false)
->answers([['id_dewey' => '888', 'libelle' => 'Actualités']])
->answers([ ['id_dewey' => '888', 'libelle' => 'Actualités']])
->whenCalled('fetchAll')
->with("select id_pcdm4,libelle from codif_pcdm4 where id_pcdm4 like'%' order by id_pcdm4 limit 100", false)
->answers([['id_pcdm4' => '566', 'libelle' => 'Bande dessiné']])
->answers([ ['id_pcdm4' => '566', 'libelle' => 'Bande dessiné']])
->whenCalled('fetchAll')
->with("select id_tag, libelle from codif_tags where code_alpha like '%EBO%' order by code_alpha limit 100", true)
->answers([ [3, 'ebook']])
->beStrict();
......@@ -71,6 +76,13 @@ class AjaxControllerSuggestTest extends AbstractControllerTestCase {
}
/** @test */
public function listeSuggestionForTagEboShouldAnswerEbook() {
$this->dispatch('/admin/ajax/listesuggestion/type_autorite/tag/id_champ/tags/mode/2/valeur/ebo', true);
$this->assertXPathContentContains('//div[@class="tag_liste"][@clef="3"]', 'ebook');
}
public function getTypeAutorites() {
return [['auteur'],
['matiere'],
......
......@@ -2778,6 +2778,7 @@ class RechercheController_IndexSearcherTest extends RechercheControllerNoticeTes
class RechercheControllerViewnoticeWithPreferencesFromOtheProfile extends RechercheControllerNoticeTestCase {
public function setUp() {
parent::setUp();
......
......@@ -40,8 +40,8 @@ class MoteurRechercheFacettesTest extends ModelTestCase {
$cache = Storm_Test_ObjectWrapper::mock();
$cache
->whenCalled('test')->answers(false)
->whenCalled('load')->answers(null)
->whenCalled('test')->answers(null)
->whenCalled('save')->answers(null);
Storm_Cache::setDefaultZendCache($cache);
......
This diff is collapsed.
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