diff --git a/library/Class/CollectionFusion.php b/library/Class/CollectionFusion.php index ee38ad39678d49d3f17b80bbb7016630971b4d81..260dc22c301d9de192b6220a051ee9c758d3155d 100644 --- a/library/Class/CollectionFusion.php +++ b/library/Class/CollectionFusion.php @@ -29,7 +29,7 @@ class Class_CollectionFusion extends Storm_Model_Abstract{ } - public function getElements() { + public function getEach() { return $this->_elements; } diff --git a/library/Class/ModeleFusion.php b/library/Class/ModeleFusion.php index b2ad432fcc00cf582a4031807a86981cdc717e93..a6faaa67952cf8a0cbf3c209c9aac608f93cd07d 100644 --- a/library/Class/ModeleFusion.php +++ b/library/Class/ModeleFusion.php @@ -23,7 +23,7 @@ <style type="text/css">@page {margin: 0;} </style> -<div style="page-break-inside:auto;">{results.elements[ +<div style="page-break-inside:auto;">{{articles|notices.each[ <div style="page-break-inside:avoid; page-break-after:auto;overflow:hidden;float:left; clear:both; padding: 20px; margin: 20px 0; border: 2px solid black;width:190mm;"><strong>Article: {titre}</strong><br /> dates: {debut}- {fin}<br /> {description}</div> diff --git a/library/ZendAfi/Controller/Action.php b/library/ZendAfi/Controller/Action.php index bbe59537dcae632d33fb0a63f0dc34a8e2c3f209..a7182d3f4f2a52928605461def94468ad0c7e4a7 100644 --- a/library/ZendAfi/Controller/Action.php +++ b/library/ZendAfi/Controller/Action.php @@ -419,7 +419,7 @@ class ZendAfi_Controller_Action extends Zend_Controller_Action { $this->view->lettre = Class_ModeleFusion::getBibliorecord($this->_getParam('modele_fusion')); $this->view->lettre - ->setDataSource(['results' => new Class_CollectionFusion($models)]); + ->setDataSource([strtolower(Storm_Inflector::pluralize($strategy)) => new Class_CollectionFusion($models)]); $this->_helper->getHelper('viewRenderer')->setLayoutScript('empty.phtml'); $this->renderScript('print.phtml'); diff --git a/tests/application/modules/opac/controllers/CmsControllerPrintActionTest.php b/tests/application/modules/opac/controllers/CmsControllerPrintActionTest.php index 9c126aed7dca37b0a9017a7da853184f1a183472..ed67a11dd4e6e111bcde60b296f20024619b03ac 100644 --- a/tests/application/modules/opac/controllers/CmsControllerPrintActionTest.php +++ b/tests/application/modules/opac/controllers/CmsControllerPrintActionTest.php @@ -55,7 +55,7 @@ class CmsControllerPrintActionArticleviewByDate extends AbstractControllerTestCa $this->fixture('Class_ModeleFusion', ['id' => 1, 'nom' => 'article', - 'contenu' => '<p><div>{results.elements[{contenu}]}</div></p>', + 'contenu' => '<p><div>{notices.each[{contenu}]}</div></p>', 'type' => 'Article']); } diff --git a/tests/application/modules/opac/controllers/RechercheControllerPrintActionTest.php b/tests/application/modules/opac/controllers/RechercheControllerPrintActionTest.php index 7f79c1385ab696b3f124198c368c6a4da9a10e9a..4d98d756c1e7e6b7d019de2b1e13cb6706e2d3d6 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerPrintActionTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerPrintActionTest.php @@ -27,8 +27,9 @@ class RechercheControllerPrintActionLinkTest extends AbstractControllerTestCase $this->fixture('Class_ModeleFusion', ['id' => 1, 'nom' => 'recherche', - 'contenu' => '<p> {results.elements[<img src="{url_vignette}"/> {titre_principal} <div>{article.contenu}</div> -]}</p>']); + 'contenu' => '<p> {notices.each[<img src="{url_vignette}"/> {titre_principal} <div>{article.contenu}</div> +]}</p>', + 'type' => 'Notice']); $this->fixture('Class_Catalogue', ['id'=>3, @@ -50,7 +51,7 @@ class RechercheControllerPrintActionLinkTest extends AbstractControllerTestCase /** @test */ public function printLinkShouldBePresent() { - $this->assertXPathContentContains('//a[contains(@href, "/recherche/print/id_catalogue/3/id_module/9/aleatoire/1/ids/1/strategy/recherche/modele_fusion/1")]', 'Imprimer'); + $this->assertXPathContentContains('//a[contains(@href, "/recherche/print/id_catalogue/3/id_module/9/aleatoire/1/ids/1/strategy/Notice/modele_fusion/1")]', 'Imprimer'); } } @@ -64,7 +65,7 @@ class RechercheControllerPrintActionWithRecordsTest extends AbstractControllerTe $this->fixture('Class_ModeleFusion', ['id' => 1, 'nom' => 'recherche', - 'contenu' => '<p> {results.elements[<img src="{url_vignette}"/> {titre_principal} <div>{article.contenu}</div> + 'contenu' => '<p> {notices.each[<img src="{url_vignette}"/> {titre_principal} <div>{article.contenu}</div> ]}</p>']); Class_Indexation_PseudoNotice::index( $this->fixture('Class_Article' , ['id' => 10, @@ -80,7 +81,7 @@ class RechercheControllerPrintActionWithRecordsTest extends AbstractControllerTe 'notice' => new Class_Notice(), 'type_doc_id' => Class_TypeDoc::ARTICLE])); - $this->dispatch("/recherche/print/expressionRecherche/pomme/strategy/recherche/ids/1%3B2/modele_fusion/1",true); + $this->dispatch("/recherche/print/expressionRecherche/pomme/strategy/Notice/ids/1%3B2/modele_fusion/1",true); } diff --git a/tests/application/modules/opac/controllers/RechercheControllerTest.php b/tests/application/modules/opac/controllers/RechercheControllerTest.php index 09c888068cd52df6df3e721d9d61befdd1e6e410..fb9155327a372162c33bda896de98e47837b7d0e 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerTest.php @@ -2754,7 +2754,7 @@ class RechercheControllerPrintActionTest extends AbstractControllerTestCase { */ $this->fixture('Class_ModeleFusion', ['id' => 1, 'nom' => 'pomme', - 'contenu' => '<p> {moteurRecherche_resultat.notices[<img src="{url_vignette}"/> {titre_principal} <div>{article.contenu}</div> + 'contenu' => '<p> {articles.each[<img src="{url_vignette}"/> {titre_principal} <div>{article.contenu}</div> ]}</p>']); Class_Indexation_PseudoNotice::index( $this->fixture('Class_Article' , ['id' => 10, 'titre' => 'pomme',