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

hotline #72437 fix rt

parent 00081322
Branches
Tags
3 merge requests!2542Master,!2541Hotline,!2536hotline #72297 : fix call notice from exemplaire without notice
Pipeline #3647 passed with stage
in 33 minutes and 34 seconds
- ticket #72297 : Corrige le probleme d'intégration si un exemplaire n'a plus de notice
\ No newline at end of file
- ticket #72297 : Cosmogramme : correction du système de dédoublonnage
\ No newline at end of file
......@@ -182,8 +182,8 @@ class Class_Exemplaire extends Storm_Model_Abstract {
public function getTomeAlpha() {
return $this->getNotice() ?
$this->getNotice()->getTomeAlpha()
return ($record = $this->getNotice())
? $record->getTomeAlpha()
: '';
}
......@@ -227,43 +227,43 @@ class Class_Exemplaire extends Storm_Model_Abstract {
public function getTitrePrincipal() {
return $this->getNotice()
? $this->getNotice()->getTitrePrincipal()
return ($record = $this->getNotice())
? $record->getTitrePrincipal()
: '';
}
public function getTitreEtSousTitre() {
return $this->getNotice()
? $this->getNotice()->getTitreEtSousTitre()
return ($record = $this->getNotice())
? $record->getTitreEtSousTitre()
: '';
}
public function getAuteurPrincipal() {
return $this->getNotice()
? $this->getNotice()->getAuteurPrincipal()
return ($record =$this->getNotice())
? $record->getAuteurPrincipal()
: '';
}
public function getEditeur() {
return $this->getNotice()
? $this->getNotice()->getEditeur()
return ($record = $this->getNotice())
? $record->getEditeur()
: '';
}
public function getCollectionPrincipale() {
return $this->getNotice()
? $this->getNotice()->getCollections(true)
return ($record = $this->getNotice())
? $record->getCollections(true)
: '';
}
public function getTypeDoc() {
return $this->getNotice()
? $this->getNotice()->getTypeDoc()
return ($record = $this->getNotice())
? $record->getTypeDoc()
: '';
}
......@@ -348,7 +348,10 @@ class Class_Exemplaire extends Storm_Model_Abstract {
public function toUnimarcIso2709() {
$writer = new Class_NoticeUnimarc_Writer();
$writer->setNotice($this->getNotice()->getUnimarc());
$unimarc = ($record = $this->getNotice())
? $record->getUnimarc()
: '';
$writer->setNotice($unimarc);
$subfields = [];
foreach ($this->zone995toArray() as $subfield)
$subfields[] = [$this->get995Key($subfield), $subfield['valeur']];
......@@ -434,7 +437,9 @@ class Class_Exemplaire extends Storm_Model_Abstract {
public function isSigbLoanable() {
$record = $this->getNotice();
if(!$record = $this->getNotice())
return false;
return $this->isLoanable() && (!$record->isDilicom());
}
}
\ No newline at end of file
......@@ -92,35 +92,32 @@ abstract class DoubleFinderTestCase extends ModelTestCase {
}
class DoubleFinderWithNotNoticeTest extends DoubleFinderTestCase {
class DoubleFinderWithNoNoticeTest extends DoubleFinderTestCase {
protected $_data = ['type_doc' => Class_TypeDoc::DILICOM,
'statut_exemplaires' => ['nb_ex' => 1],
'exemplaires' => [ ['code_barres' => '302'] ]];
public function setUp() {
parent::setUp();
$this->_prepareFixtures();
protected function _prepareFixtures() {
$this->fixture('Class_Exemplaire',
['id' => 30,
'code_barres' => '302',
'id_origine' => '789',
'type_doc' => Class_TypeDoc::DILICOM,
'id_int_bib' => 1]);
$this->_finder = new Class_Notice_BarcodeDoubleFinder($this->_data, $this->_library_id);
$this->_found = $this->_finder->find();
['id' => 30,
'code_barres' => '302',
'id_origine' => '789',
'type_doc' => Class_TypeDoc::DILICOM,
'id_int_bib' => 1]);
}
/** @test */
public function WithExemplaireWithoutNoticeShouldNotFound() {
$this->assertFalse($this->_found);
}
}
}
class DoubleFinderWithoutAnyRecordTest extends DoubleFinderTestCase {
/** @test */
public function shouldNotFindDouble() {
......
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