diff --git a/VERSIONS_HOTLINE/97222 b/VERSIONS_HOTLINE/97222 new file mode 100644 index 0000000000000000000000000000000000000000..176ba82e1bb7b58957708dacaebfd56c62fd43a5 --- /dev/null +++ b/VERSIONS_HOTLINE/97222 @@ -0,0 +1 @@ + - ticket #97222: OPAC Compte utilisateur : La page d'impression de la liste de prêt dans le compte utilisateur à l'OPAC n'affichait pas les données \ No newline at end of file diff --git a/application/modules/opac/views/scripts/print.phtml b/application/modules/opac/views/scripts/print.phtml index 272b2434bcc5366b648a4236b7efb9a4884c55ac..fc0e8c9ff08fe956eb09a711e1f79940701f0d30 100644 --- a/application/modules/opac/views/scripts/print.phtml +++ b/application/modules/opac/views/scripts/print.phtml @@ -1,3 +1,11 @@ -<?php -echo $this->tagModelFusion($this->params); -?> +<!DOCTYPE html> +<html lang="<?php echo $this->_translate()->getLocale() ?>"> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> + </head> + <body> + <?php + echo $this->tagModelFusion($this->params); + ?> + </body> +</html> diff --git a/library/ZendAfi/View/Helper/ModeleFusion/Template/Loans.php b/library/ZendAfi/View/Helper/ModeleFusion/Template/Loans.php index e801960ccc64d43a0097a06ec254d7143dd25221..655beeb126a783fd14cc4decefc230907f109272 100644 --- a/library/ZendAfi/View/Helper/ModeleFusion/Template/Loans.php +++ b/library/ZendAfi/View/Helper/ModeleFusion/Template/Loans.php @@ -28,19 +28,19 @@ class ZendAfi_View_Helper_ModeleFusion_Template_Loans extends ZendAfi_View_Helpe protected function _getRow() { $html = [$this->_tag('h1', - $this->_('Titre : {getTitle}')), + $this->_('Titre : {title}')), - $this->_tag('span', '{getThumbnail}'), + $this->_tag('span', '{thumbnail}'), - $this->_tag('span', $this->_('emprunté par : {getLoanedBy}')), + $this->_tag('span', $this->_('Emprunté par : {loaned_by}')), - $this->_tag('span', $this->_('code barre : {getBarCode}')), + $this->_tag('span', $this->_('Code-barre : {bar_code}')), - $this->_tag('span', $this->_('Auteur : {getAuthor}')), + $this->_tag('span', $this->_('Auteur : {author}')), - $this->_tag('span', $this->_('date de prêt : {getIssueDate}')), + $this->_tag('span', $this->_('Date de prêt : {issue_date}')), - $this->_tag('span', $this->_('dates de retour prévu : {getReturnDate}')), + $this->_tag('span', $this->_('Date de retour prévue : {return_date}')), ]; return $this->_getRowWrapper(implode(BR, $html)); diff --git a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php index 29afa75929066d772190d96017fd4312cc39cb22..63be51b750b03d0d4fbd2d3abc34ba67bc52f1c8 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php @@ -162,13 +162,16 @@ abstract class AbonneControllerPretsListThreePretsTestCase extends AbstractAbonn 'notice' => $this->fixture('Class_Notice', ['id' => 827, 'titre_principal' => 'Alice', - 'unimarc' => '01175cam0 22002771 450 001001500000010003700015100004100052101000800093102000700101105001800108106000600126200009300132210002400225211001300249215006400262300002400326307002900350330027300379345001800652461005600670700001800726701003000744801003300774856008300807940000700890frOr0354235228 a978-2-35592-635-8bbr.d7,65 EUR a20140225d2014 | |0fre|0103||||ba afre aFR a 0||y| ar1 aAlice au royaume de TrèfleeCheshire cat Waltzh5fQuinRosegdessin Mamenosuke Fujimaru aPariscKi-oond2014 1a20140227 a1 vol. (164 p.)cillustrations en noir et blancd18 x 13 cm aTraduit du japonais aSens de lecture japonais aPerdue dans la forêt aux portes, Alice tombe nez à nez avec Ace. Devenue malgré elle la confidente du chevalier, elle ne sait comment repousser ses avances. Lorsque le chat du Cheshire, qui a assisté à la scène, intervient, la rencontre tourne à l\'affrontement. b9782355926358 1tAlice au royaume de Trèfle : Cheshire cat Waltzv5 1aQuinRose4070 1aFujimarubMamenosuke4440 aFRbElectrec20140225gAFNOR uhttp://www.electre.com//GetBlob.ashx?Ean=9782355926358,0-1913692&Size=Original aLR'])])); + 'unimarc' => '01175cam0 22002771 450 001001500000010003700015100004100052101000800093102000700101105001800108106000600126200009300132210002400225211001300249215006400262300002400326307002900350330027300379345001800652461005600670700001800726701003000744801003300774856008300807940000700890frOr0354235228 a978-2-35592-635-8bbr.d7,65 EUR a20140225d2014 | |0fre|0103||||ba afre aFR a 0||y| ar1 aAlice au royaume de TrèfleeCheshire cat Waltzh5fQuinRosegdessin Mamenosuke Fujimaru aPariscKi-oond2014 1a20140227 a1 vol. (164 p.)cillustrations en noir et blancd18 x 13 cm aTraduit du japonais aSens de lecture japonais aPerdue dans la forêt aux portes, Alice tombe nez à nez avec Ace. Devenue malgré elle la confidente du chevalier, elle ne sait comment repousser ses avances. Lorsque le chat du Cheshire, qui a assisté à la scène, intervient, la rencontre tourne à l\'affrontement. b9782355926358 1tAlice au royaume de Trèfle : Cheshire cat Waltzv5 1aQuinRose4070 1aFujimarubMamenosuke4440 aFRbElectrec20140225gAFNOR uhttp://www.electre.com//GetBlob.ashx?Ean=9782355926358,0-1913692&Size=Original aLR', + 'url_image' => 'Alice.jpg', + ])])); $alice->parseExtraAttributes(['Dateretourprevue' => '21/10/2010', 'Section' => 'Espace jeunesse', 'Auteur' => 'Lewis Caroll', 'Bibliotheque' => 'Almont', 'N° de notice' => '5678']); + $alice->setIssueDate('10/10/2010'); $this->fixture('Class_Exemplaire', ['id' => 918, @@ -1155,28 +1158,44 @@ class AbonneControllerBarcodesExportThreePretsTest extends AbonneControllerPrets class AbonneControllerPrintActionPretsTest extends AbonneControllerPretsListThreePretsTestCase { public function setUp() { parent::setUp(); + $helper = new ZendAfi_View_Helper_ModeleFusion_Template_Loans(); + $helper->setView(new ZendAfi_Controller_Action_Helper_View()); + $this->fixture('Class_ModeleFusion', ['id' => 9, 'type' => 'Loans_List', 'nom' => 'loans', - 'contenu' => '<div style="page-break-inside:auto">{loans.each[ -<div style="page-break-inside:avoid; page-break-after:auto;overflow:hidden;float:left;clear:both;padding: 0.5em;margin: 0.5em 0;border: 1px solid black;width:190mm;box-shadow: 0px 0px 5px;"> -<h1>Titre : {title}</h1> -<br /> -<span>{thumbnail}</span><br /> -<span>emprunté par : {loaned_by}</span><br /> -<span>code barre : {bar_code}</span><br /> -<span>Auteur : {author}</span><br /> -<span>date de prêt : {issue_date}</span><br /> -<span>dates de retour prévu : {return_date}</span></div> -]}</div>']); + 'contenu' => $helper->ModeleFusion_Template_Loans()]); $this->dispatch('abonne/print/ids/reload/strategy/Loans_List/modele_fusion/9', true); } /** @test */ - public function responseShouldContainsSomethings() { - $this->assertXPathContentContains('//div', 'Titre : Alice au royaume de '); + public function h1ShouldContainsAliceAuRoyaume() { + $this->assertXPathContentContains('//h1', 'Titre : Alice au royaume de '); + } + + /** @test */ + public function spanShouldContainsThumbnailAliceDotJpg() { + $this->assertXPath('//span//img[contains(@src, "Alice.jpg")]'); + } + + /** @test */ + public function spanShouldContainsCodeBarre124() { + $this->assertXPathContentContains('//span', 'Code-barre : 124'); + } + + + /** @test */ + public function spanShouldContainsDateRetour21102010() { + $this->assertXPathContentContains('//span', utf8_encode('Date de retour prévue : 21/10/2010'), + $this->_response->getBody()); + } + + + /** @test */ + public function spanShouldContainsDateDePret10102010() { + $this->assertXPathContentContains('//span', utf8_encode('Date de prêt : 10/10/2010')); } }