Skip to content
Snippets Groups Projects
Commit 3a20d5f4 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'hotline#37288_localisation_d_un_exemplaire_inccorect' into 'stable'

Hotline#37288 localisation d un exemplaire inccorect

See merge request !1493
parents e6a8e22c f21164f2
Branches
Tags
8 merge requests!1587Master,!1553Master,!1519Master,!1505Stable,!1502Master,!1501Stable,!1500Master,!1496Stable
- ticket #37288 : Correction de la localisation des exemplaires
\ No newline at end of file
......@@ -80,9 +80,9 @@ class Class_Exemplaire extends Storm_Model_Abstract {
public function getBestCote() {
if($this->_sigb_exemplaire &&
($sigb_cote = $this->_sigb_exemplaire->getCote()) &&
(strlen($sigb_cote) > strlen($this->getCote())))
if ($this->getSigbExemplaire() &&
($sigb_cote = $this->getSigbExemplaire()->getCote()) &&
(strlen($sigb_cote) > strlen($this->getCote())))
return $sigb_cote;
return $this->getCote();
......
......@@ -232,12 +232,15 @@ class Class_Localisation extends Storm_Model_Abstract {
$quality = count(array_intersect_assoc($matching_datas, $exemplaire_datas));
if ($quality < count($matching_datas) && $quality < (count($exemplaire_datas)))
return null;
if( 0 > ($cote_quality = $this->coteMatchingQuality($exemplaire)))
return null;
$quality += $cote_quality;
return [$quality => $this];
return ($quality > 0) ? [$quality => $this] : null;
}
......
......@@ -87,6 +87,17 @@ class LocalisationTest extends Storm_Test_ModelTestCase {
'libelle' => 'CD Jazz',
'cote_debut' => 'CDJazz A',
'cote_fin' => 'CDJazz Z']);
$this->fixture('Class_Localisation',
['id' => 22,
'id_bib' => 1,
'annexe' => 1,
'section' => 'J',
'genre' => 'B',
'libelle' => 'CD Jazz Broken',
'cote_debut' => 'CDJazz A',
'cote_fin' => 'CDJazz Z',
'type_doc' => 2]);
}
......
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