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

fix #17568 : do not try to get ILS item when item doesn't have a library (pseudo records)

parent 994d5d05
Branches
Tags
2 merge requests!529Hotline 6.56,!522Hotline#17568 search result with article record broken
......@@ -16,12 +16,12 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Exemplaire extends Storm_Model_Abstract {
protected $_table_name = 'exemplaires';
protected $_table_primary = 'id';
protected $_table_primary = 'id';
protected $_belongs_to = [
'notice' => ['model' => 'Class_Notice',
......@@ -43,12 +43,12 @@ class Class_Exemplaire extends Storm_Model_Abstract {
protected $_sigb_exemplaire;
public function isPrete() {
return $this->hasPret();
}
public function getPret() {
return Class_Pret::getLoader()->findFirstBy(['id_site' => $this->getIdBib(),
'id_notice_origine' => $this->getIdOrigine(),
......@@ -88,10 +88,10 @@ class Class_Exemplaire extends Storm_Model_Abstract {
public function getSigbExemplaire() {
if (!isset($this->_sigb_exemplaire))
if (!isset($this->_sigb_exemplaire) && $this->hasIntBib())
$this->_sigb_exemplaire = $this->getIntBib()
->getSigbExemplaire(
$this->getIdOrigine(),
$this->getIdOrigine(),
$this->getCodeBarres());
return $this->_sigb_exemplaire;
}
......@@ -158,10 +158,10 @@ class Class_Exemplaire extends Storm_Model_Abstract {
return $sigbExemplaire->isReservable();
}
public function getSubfield($id) {
$fields = $this->zone995toArray();
foreach($fields as $field)
foreach($fields as $field)
if ($id == $this->get995Key($field))
return $field['valeur'];
return '';
......@@ -171,7 +171,7 @@ class Class_Exemplaire extends Storm_Model_Abstract {
protected function zone995toArray() {
return (!$datas = unserialize($this->getZone995())) ? [] : $datas;
}
public function toUnimarcIso2709() {
$writer = new Class_NoticeUnimarc_Writer();
......@@ -180,7 +180,7 @@ class Class_Exemplaire extends Storm_Model_Abstract {
foreach ($this->zone995toArray() as $subfield)
$subfields[] = [$this->get995Key($subfield), $subfield['valeur']];
$writer->add_field('995', ' 1', $subfields);
return $writer->toUnimarcIso2709();
return $writer->toUnimarcIso2709();
}
......@@ -189,7 +189,7 @@ class Class_Exemplaire extends Storm_Model_Abstract {
return '';
$ret = '';
foreach($datas as $data)
foreach($datas as $data)
$ret .= $this->get995Key($data) . '=' . $data['valeur'] . "<br>";
return $ret;
}
......
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