Skip to content
Snippets Groups Projects
Commit 38eacbdd authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline #143652 ajax paginated list anchors forward inspector_gadget

parent 7f9fddb8
Branches
Tags
1 merge request!4290hotline #143652 ajax paginated list anchors forward inspector_gadget
Pipeline #15426 passed with stage
in 28 minutes and 27 seconds
- 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
......@@ -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,
......
......@@ -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")]');
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment