diff --git a/VERSIONS_HOTLINE/143652 b/VERSIONS_HOTLINE/143652 new file mode 100644 index 0000000000000000000000000000000000000000..8ada5da373617a2905e5024db2a9562985b3c22e --- /dev/null +++ b/VERSIONS_HOTLINE/143652 @@ -0,0 +1,2 @@ + - ticket #143652 : Magasin de thèmes : Affichage d'informations complémentaires sur les sélections lorsqu'Inspecteur Gadget est activé. + Correction du fonctionnement avec le rendu de liste à interactions. \ No newline at end of file diff --git a/library/templates/Intonation/View/RenderAjaxPaginatedList.php b/library/templates/Intonation/View/RenderAjaxPaginatedList.php index d7be82038ddbe2221be225fd4b951e8162667d73..5305bcf2ca9f41cf33161cd5ebd789cca16fbb44 100644 --- a/library/templates/Intonation/View/RenderAjaxPaginatedList.php +++ b/library/templates/Intonation/View/RenderAjaxPaginatedList.php @@ -36,10 +36,10 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe $callback = $callback ? $callback : function($element) use ($helper) { - $element->setView($this->view); - $element->setModel($element->getModel()); - return call_user_func_array([$this->view, $helper->getRendering()], [$element]); - }; + $element->setView($this->view); + $element->setModel($element->getModel()); + return call_user_func_array([$this->view, $helper->getRendering()], [$element]); + }; $html_collection = $this->view->div(['class' => 'list-group bg-transparent no_border', @@ -95,12 +95,12 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe $previous_page = $current_page -1; - $anchor_previous_url = $this->view->url(['controller' => 'index', - 'action' => 'ajax-paginated-list', - 'id' => $this->_id, - 'size' => $page_size, - 'page' => $current_page -1, - 'search' => $search], null, true); + $anchor_previous_url = Class_Url::assemble(['controller' => 'index', + 'action' => 'ajax-paginated-list', + 'id' => $this->_id, + 'size' => $page_size, + 'page' => $previous_page, + 'search' => $search]); $anchor_previous = $this->view->tagAnchor($anchor_previous_url, $this->_tag('i','',['class' => 'fas fa-chevron-left m-0']), @@ -112,15 +112,13 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe $next_page = $current_page +1; - $anchor_next_url = $this->view->url(['controller' => 'index', - 'action' => 'ajax-paginated-list', - 'id_profil' => Class_Profil::getCurrentProfil()->getId(), - 'id' => $this->_id, - 'size' => $page_size, - 'search' => $search, - 'page' => $current_page +1], - null, - true); + $anchor_next_url = Class_Url::assemble(['controller' => 'index', + 'action' => 'ajax-paginated-list', + 'id_profil' => Class_Profil::getCurrentProfil()->getId(), + 'id' => $this->_id, + 'size' => $page_size, + 'search' => $search, + 'page' => $next_page]); $anchor_next = $this->view->tagAnchor($anchor_next_url, $this->_tag('i','',['class' => 'fas fa-chevron-right m-0']), @@ -145,13 +143,13 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe $form = new ZendAfi_Form; $form - ->setAction($this->view->url(array_filter(['controller' => 'index', - 'action' => 'ajax-paginated-list', - 'id_profil' => Class_Profil::getCurrentProfil()->getId(), - 'id' => $this->_id, - 'size' => $helper->getPageSize(), - 'order' => $helper->getNewOrder(), - 'page' => 1]), null, true)) + ->setAction(Class_Url::assemble(array_filter(['controller' => 'index', + 'action' => 'ajax-paginated-list', + 'id_profil' => Class_Profil::getCurrentProfil()->getId(), + 'id' => $this->_id, + 'size' => $helper->getPageSize(), + 'order' => $helper->getNewOrder(), + 'page' => 1]))) ->addElement('select', 'select_' . $this->_id, diff --git a/tests/scenarios/Templates/TemplatesItemsPaginatedTest.php b/tests/scenarios/Templates/TemplatesItemsPaginatedTest.php index 688b161f951e50bd8ec7cc114781f8ab2197a567..0f0afc62ec857421a14316457dd7ef011ed30c0e 100644 --- a/tests/scenarios/Templates/TemplatesItemsPaginatedTest.php +++ b/tests/scenarios/Templates/TemplatesItemsPaginatedTest.php @@ -48,7 +48,7 @@ abstract class TemplateItemsPaginatedTestCase extends AbstractControllerTestCas $this->_buildItems(Intonation_View_RenderTruncateList::ajaxSize() + 1); - $this->dispatch('/noticeajax/resources/id/456'); + $this->dispatch('/noticeajax/resources/id/456/inspector_gadget/1'); } @@ -98,7 +98,7 @@ abstract class TemplateItemsPaginatedTestCase extends AbstractControllerTestCas /** @test */ public function shouldHaveLinkToNextPage() { - $this->assertXPath('//a[contains(@href,"/index/ajax-paginated-list/id_profil/1/id/")][contains(@href,"/size/10/page/2")]'); + $this->assertXPath('//a[contains(@href,"/index/ajax-paginated-list/id_profil/1/id/")][contains(@href,"/size/10/page/2/inspector_gadget/1")]'); }