Skip to content
Snippets Groups Projects

Hotline#12799 V Smart Item Status 8 Holdable

Merged Patrick Barroca requested to merge hotline#12799-VSmart-item-status-8-holdable into hotline_6.40
Compare and
+ 97
166
Preferences
Compare changes
Files
@@ -21,23 +21,23 @@
class Class_WebService_SIGB_VSmart_SearchResponseReader extends Class_WebService_SIGB_AbstractMarcXMLNoticeReader {
protected $_current_exemplaire;
protected $_STATUT_SYSTEME = array('0' => 'Disponible',
'4' => 'En prêt',
'8' => 'En attende de retrait',
'10' => 'En déplacement',
'23' => 'Non empruntable',
'11' => 'Prétendu rendu',
'12' => 'Perdu',
'13' => 'Manquant',
'21' => 'Autre',
'22' => 'Nouveauté',
'25' => 'En rachat',
'26' => 'En réparation',
'27' => 'En magasin',
'28' => 'Pilon',
'29' => 'Exclu du prêt',
'30' => 'En commande',
'31' => 'A l\'équipement');
protected $_STATUT_SYSTEME = ['0' => 'Disponible',
'4' => 'En prêt',
'8' => 'En attende de retrait',
'10' => 'En déplacement',
'23' => 'Non empruntable',
'11' => 'Prétendu rendu',
'12' => 'Perdu',
'13' => 'Manquant',
'21' => 'Autre',
'22' => 'Nouveauté',
'25' => 'En rachat',
'26' => 'En réparation',
'27' => 'En magasin',
'28' => 'Pilon',
'29' => 'Exclu du prêt',
'30' => 'En commande',
'31' => 'A l\'équipement'];
public static function newInstance() {
return new self();
@@ -70,16 +70,21 @@ class Class_WebService_SIGB_VSmart_SearchResponseReader extends Class_WebService
public function endSubfield_852_y($data) {
$this->_current_exemplaire->setReservable($data == '4');
$this->_current_exemplaire
->setReservable($this->isReservable($data));
$dispo = (array_key_exists($data, $this->_STATUT_SYSTEME))
? $this->_STATUT_SYSTEME[$data] : 'Inconnu';
if (array_key_exists($data, $this->_STATUT_SYSTEME))
$dispo = $this->_STATUT_SYSTEME[$data];
else
$dispo = 'Inconnu';
$this->_current_exemplaire->setDisponibilite($dispo);
}
protected function isReservable($data) {
return in_array((int)$data, [4, 8]);
}
public function endSubfield_852_u($data) {
$this->_current_exemplaire->setVisibleOpac($data != '0');
}
@@ -89,18 +94,14 @@ class Class_WebService_SIGB_VSmart_SearchResponseReader extends Class_WebService
$date = $data;
// date reçue au format AAAAMMJJ, transformée en jj/mm/aaaa
if (8 == strlen($date)) {
$parts = array(
substr($data, 6, 2),
substr($date, 4, 2),
substr($date, 0, 4),
);
$parts = [substr($data, 6, 2),
substr($date, 4, 2),
substr($date, 0, 4)];
$date = implode('/', $parts);
}
$this->_current_exemplaire->setDateRetour($date);
}
}