diff --git a/application/modules/opac/views/scripts/abonne/prets.phtml b/application/modules/opac/views/scripts/abonne/prets.phtml index 362847e6fea17b7d18233cd548257036f03afc60..6c1ca2944c2442e6d1eed4b9b99d113906d47e0d 100644 --- a/application/modules/opac/views/scripts/abonne/prets.phtml +++ b/application/modules/opac/views/scripts/abonne/prets.phtml @@ -14,11 +14,13 @@ if($this->fiche["erreur"]) echo '<p class="error">' . $this->fiche["erreur"] . ' <th style="text-align:left"><?php echo $this->_('Auteur') ?></th> <th style="text-align:left"><?php echo $this->_('Bibliothèque') ?></th> <th style="text-align:center"><?php echo $this->_('Retour prévu') ?></th> + <th style="text-align:center"><?php echo $this->_('Informations') ?></th> </tr> </thead> <tbody> <?php $num=1; + if(isset($this->fiche["fiche"])) { foreach($this->fiche["fiche"]->getEmprunts() as $emprunt) { $class_retard = $emprunt->enRetard() ? 'class="pret_en_retard"' : ''; @@ -37,6 +39,7 @@ if($this->fiche["erreur"]) echo '<p class="error">' . $this->fiche["erreur"] . ' 'id_pret' => $emprunt->getId())), $this->_('Prolonger')); echo '</td>'; + echo '<td>'.$emprunt->getType().'</td>'; echo '</tr>'; } } diff --git a/library/Class/Profil.php b/library/Class/Profil.php index 55dbda7ea851358fec198e541a07862303a887f5..08cdab34455f977620ef12cb2c13228d757a82cf 100644 --- a/library/Class/Profil.php +++ b/library/Class/Profil.php @@ -905,8 +905,7 @@ class Class_Profil extends Storm_Model_Abstract { * @return mixed */ public function _get($field) { -// if($field == 'cfg_menus') -// xdebug_break(); + // Prends l'attribut parent s'il y en a un if ($this->shouldForwardAttributeToParent($field)) return $this->getParentProfil()->_get($field); diff --git a/library/Class/WebService/SIGB/Emprunt.php b/library/Class/WebService/SIGB/Emprunt.php index 1ed3bbca9fb8f185bc9cc07bd74e1c9ac1188def..70bd3deb52c2956a2401d72916a62b84714b9e32 100644 --- a/library/Class/WebService/SIGB/Emprunt.php +++ b/library/Class/WebService/SIGB/Emprunt.php @@ -22,6 +22,7 @@ class Class_WebService_SIGB_Emprunt extends Class_WebService_SIGB_ExemplaireOperation { protected $enRetard; protected $renewable = true; + protected $type = ''; /** @@ -55,8 +56,12 @@ class Class_WebService_SIGB_Emprunt extends Class_WebService_SIGB_ExemplaireOper public function onParseAttributes() { + if( !$this->type = $this->getAttribute('Type')) + $this->type = ''; + if (!$date_retour = $this->getAttribute('retour')) $date_retour = $this->getAttribute('rendre'); + return $this->setDateRetour($date_retour); } @@ -106,6 +111,17 @@ class Class_WebService_SIGB_Emprunt extends Class_WebService_SIGB_ExemplaireOper public function __toString(){ return parent::__toString().", Retour prévu:".$this->getDateRetour(); } + + + public function getType() { + return $this->type; + } + + + public function setType($type) { + $this->type = $type; + return $this; + } } ?> \ No newline at end of file diff --git a/library/Class/WebService/SIGB/Exemplaire.php b/library/Class/WebService/SIGB/Exemplaire.php index 2411911ab6fbfa03a7f632aeca3b729d8ba6917a..cd786e893f68350b60d53f6c3328d2ed352d2aff 100644 --- a/library/Class/WebService/SIGB/Exemplaire.php +++ b/library/Class/WebService/SIGB/Exemplaire.php @@ -71,6 +71,8 @@ class Class_WebService_SIGB_Exemplaire { $this->visible_opac = true; $this->_disponibiliteLabel = null; $this->_isEnPret = false; + $this->nb_resas=0; + $this->edition=''; } @@ -180,7 +182,7 @@ class Class_WebService_SIGB_Exemplaire { return $this->bibliotheque; } - + public function getAuteur(){ if (!$this->auteur and ($notice = $this->getNoticeOPAC())) $this->auteur = $notice->getAuteurPrincipal(); diff --git a/library/Class/WebService/SIGB/Opsys/Service.php b/library/Class/WebService/SIGB/Opsys/Service.php index f8fbe2b267190d936d73aa87107fd7ee7b202b0f..ef5f6da0f8b9b24fd6b303239710eeebbe00e6fa 100644 --- a/library/Class/WebService/SIGB/Opsys/Service.php +++ b/library/Class/WebService/SIGB/Opsys/Service.php @@ -174,7 +174,6 @@ class Class_WebService_SIGB_Opsys_Service extends Class_WebService_SIGB_Abstract public function getEmpruntsOf($emprunteur) { - xdebug_break(); // prets pas en retard $liste_prets_result = $this->search_client->EmprListerEntite( EmprListerEntite::prets($this->guid)); @@ -744,7 +743,6 @@ class RecupererNoticeResponse { public $RecupererNoticeResult; // RspRecupererNotice public function createNotice(){ - xdebug_break(); $rsp_notice = $this->RecupererNoticeResult->Notice; $notice = new Class_WebService_SIGB_Notice($rsp_notice->NumNotice); $notice->setReservable($rsp_notice->Reservable); @@ -858,6 +856,11 @@ class NoticeFille { } + public function getType() { + return $this->getData('Type'); + } + + public function getCodeBarre(){ return $this->getData("Code barre"); } diff --git a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php index 69af1cf6023937a637a57cf74828efdcadd987c1..7220370657dc69b318b4de399f893887490a8335 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php @@ -63,12 +63,12 @@ class AbonneControllerPretsListTwoPretsTest extends AbstractAbonneControllerPret $potter = new Class_WebService_SIGB_Emprunt('12', new Class_WebService_SIGB_Exemplaire(123)); $potter->getExemplaire()->setTitre('Potter'); - $potter->parseExtraAttributes(array( - 'Dateretourprevue' => '29/10/2022', - 'Section' => 'Espace jeunesse', - 'Auteur' => 'JK Rowling', - 'Bibliotheque' => 'Astrolabe', - 'N° de notice' => '1234')); + $potter->parseExtraAttributes(['Dateretourprevue' => '29/10/2022', + 'Section' => 'Espace jeunesse', + 'Auteur' => 'JK Rowling', + 'Bibliotheque' => 'Astrolabe', + 'N° de notice' => '1234', + 'Type' => 'P1']); $alice = new Class_WebService_SIGB_Emprunt('13', new Class_WebService_SIGB_Exemplaire(456)); $alice->getExemplaire()->setTitre('Alice'); @@ -176,6 +176,18 @@ class AbonneControllerPretsListTwoPretsTest extends AbstractAbonneControllerPret $this->assertXPathContentContains("//tbody/tr[2]//td//a[@href='/abonne/prolongerPret/id_pret/12']", 'Prolonger'); } + + /** @test **/ + public function colonneInformationShouldBeDisplay(){ + $this->assertXPathContentContains('//thead//th','Informations'); + } + + + /** @test **/ + public function colonneInformationShouldContainsP1(){ + $this->assertXPathContentContains('//tbody//td','P1', $this->_response->getBody()); + } + }