Commit e0b163e2 authored by Patrick Barroca's avatar Patrick Barroca 😁
Browse files

Merge branch 'hotline' into 'master'

Hotline

See merge request !3369
parents 2fe3370b 0b24172d
Pipeline #9159 passed with stage
in 47 minutes and 45 seconds
21/01/2020 - v8.0.39
- ticket #103837 : Affichage notices : correction de la détection de l'appartenance des exemplaires à un lot
20/01/2020 - v8.0.38
- ticket #100249 : Ressources numériques: Ajout d'un tableau de bord pour ArteVOD
......
......@@ -451,6 +451,7 @@ class Class_Exemplaire extends Storm_Model_Abstract {
return null;
}
public function toRaw() {
$raw = $this->getRawAttributes() ;
// LL: pour Opsys nous avons besoin de l'identifiant de l'annexe, d'où sauvegarde pour réutilisation dans ReservationLink
......@@ -470,6 +471,7 @@ class Class_Exemplaire extends Storm_Model_Abstract {
return $this->annexe;
}
public function getNbResas() {
return $this->getSigbExemplaire()->getNbReservations();
}
......@@ -490,15 +492,15 @@ class Class_Exemplaire extends Storm_Model_Abstract {
public function getBundle() {
if (!$data_profile = $this->getDataProfile())
if ((!$id_int_bib = $this->getIdIntBib())
|| (!$data_profile = $this->getDataProfile())
|| (!$bundle_id_field = $data_profile->getBundleIdField())
|| (!$id_origine = $this->getSubfield($bundle_id_field)))
return null;
$bundle_id_field = $data_profile->getBundleIdField();
$bundle_id = $this->getSubfield($bundle_id_field);
$bundle_item = Class_Exemplaire::getLoader()
->findFirstBy(['id_int_bib' => $this->getIdIntBib(),
'id_origine' => $bundle_id]);
->findFirstBy(['id_int_bib' => $id_int_bib,
'id_origine' => $id_origine]);
return $bundle_item
? $bundle_item->getNotice()
......
......@@ -81,7 +81,7 @@ class Bokeh_Engine {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','8.0');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.38');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.39');
defineConstant('BOKEH_REMOTE_FILES', 'https://git.afi-sa.net/afi/opacce/');
......
......@@ -295,8 +295,7 @@ class NoticeAjaxControllerItemsCustomIconsTest
class NoticeAjaxControllerItemBelongsToBundleTest
abstract class NoticeAjaxControllerItemBundleTestCase
extends NoticeAjaxControllerItemsTestCase {
protected function _prepareFixtures() {
......@@ -304,11 +303,10 @@ class NoticeAjaxControllerItemBelongsToBundleTest
$config['exemplaires']['grouper'] = '1';
Class_Profil::getCurrentProfil()->setCfgNotice($config);
$data_profile = Class_IntProfilDonnees::forKoha()->setId(23);
$data_profile
->setItemField(Class_IntProfilDonnees::FIELD_ITEM_BUNDLE_ID,
7)
$this->_bundleIdField())
->save();
$bundled_item = $this->fixture('Class_Exemplaire',
......@@ -337,7 +335,6 @@ class NoticeAjaxControllerItemBelongsToBundleTest
'valeur' => '']])
]);
$bundle_not_exists = $this->fixture('Class_Exemplaire',
['id' => 103,
'id_bib' => 3,
......@@ -352,7 +349,7 @@ class NoticeAjaxControllerItemBelongsToBundleTest
]);
$no_bundle_field = $this->fixture('Class_Exemplaire',
['id' => 103,
['id' => 104,
'id_bib' => 3,
'id_int_bib' => 3,
'section' => 14,
......@@ -363,7 +360,6 @@ class NoticeAjaxControllerItemBelongsToBundleTest
'zone995' => serialize([[]])
]);
$this->fixture('Class_Notice',
['id' => 34,
'titre_principal' => 'La fausse malle du piège du int_bib',
......@@ -374,7 +370,6 @@ class NoticeAjaxControllerItemBelongsToBundleTest
'id_origine' => 87346])
]]);
$this->fixture('Class_Notice',
['id' => 25,
'titre_principal' => 'Se faire la malle',
......@@ -395,10 +390,56 @@ class NoticeAjaxControllerItemBelongsToBundleTest
}
protected function _bundleIdField() {
return null;
}
}
class NoticeAjaxControllerItemBelongsToBundleTest
extends NoticeAjaxControllerItemBundleTestCase {
protected function _bundleIdField() {
return 7;
}
/** @test */
public function tdShouldContainsLinkToRecordSeFaireLaMalleId25() {
$this->assertXPathContentContains('//td//a[contains(@href, "/recherche/viewnotice/id/25")]',
'Fait partie du lot "Se faire la malle"');
}
}
/** @see http://forge.afi-sa.fr/issues/103837 */
class NoticeAjaxControllerItemWithEmptyBundleIdTest
extends NoticeAjaxControllerItemBundleTestCase {
protected function _bundleIdField() {
return 7;
}
/** @test */
public function tdShouldNotContainsLinkToEmptyBundle() {
$this->assertNotXPathContentContains('//td//a', 'Fait partie du lot ""');
}
}
/** @see http://forge.afi-sa.fr/issues/103837 */
class NoticeAjaxControllerItemBelongsToBundleButWithoutBundleFieldIdTest
extends NoticeAjaxControllerItemBundleTestCase {
/** @test */
public function tdShouldNotContainsLinkToRecordSeFaireLaMalleId25() {
$this->assertNotXPathContentContains('//td//a[contains(@href, "/recherche/viewnotice/id/25")]',
'Fait partie du lot "Se faire la malle"');
}
}
\ No newline at end of file
Markdown is supported
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