Commit b651dbf6 authored by efalcy's avatar efalcy

hotline #10927: liste verticale intercation bootstrap fix

parent 95d1bd15
Pipeline #10501 passed with stage
in 44 minutes and 13 seconds
- ticket #109427 : Magasin de thème : correction de la pagination/recherche dans la liste verticale à intercations
\ No newline at end of file
......@@ -147,6 +147,7 @@ class Intonation_Library_AjaxPaginatedListHelper {
{
$element
->setView($this->_view)
->setModel($element->getModel())
->inJsSearch();
return false !== strpos(strtolower($element->getContentForJSSearch()), $term);
});
......
......@@ -32,6 +32,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe
$callback = function($element) use ($helper) {
$element->setView($this->view);
$element->setModel($element->getModel());
return call_user_func_array([$this->view, $helper->getRendering()], [$element]);
};
......@@ -62,7 +63,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe
$page_size = $helper->getPageSize();
$count_pages = ceil( $count_result / $page_size );
$count_pages = $count_pages < 1 ? 1 : $count_pages ;
return $this->view->div([],
implode([$this->view->tagAnchor(['controller' => 'index',
'action' => 'ajax-paginated-list',
......@@ -79,6 +80,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe
$this->view->tagAnchor(['controller' => 'index',
'action' => 'ajax-paginated-list',
'id_profil' => Class_Profil::getCurrentProfil()->getId(),
'id' => $this->_id,
'page' => $current_page +1],
$this->_tag('i','',['class' => 'fas fa-chevron-right m-0']),
......@@ -95,6 +97,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe
$form
->setAction($this->view->url(['controller' => 'index',
'action' => 'ajax-paginated-list',
'id_profil' => Class_Profil::getCurrentProfil()->getId(),
'id' => $this->_id,
'size' => $helper->getPageSize(),
'page' => 1], null, true))
......
......@@ -3491,6 +3491,63 @@ class TemplatesDispatchAbonneLoansTest extends TemplatesIntonationAccountTestCas
}
/** @test */
public function page2ReviewsShouldContainsSearchInputWithMd5Key() {
Storm_Cache::beVolatile();
$this->fixture('Class_AvisNotice',
['id' => 4,
'id_user' => 666,
'id_notice' => 2,
'clef_oeuvre' => 'PSYKO',
'note' => '4',
'entete' => 'Le Roi',
'avis' => 'Le Roi des cons sur son throne',
'source_author' => null]);
$this->fixture('Class_AvisNotice',
['id' => 5,
'id_user' => 666,
'id_notice' => 3,
'clef_oeuvre' => 'PSYKO',
'note' => '4',
'entete' => 'Le Roi des cons avec sa couronne',
'avis' => 'Le Roi des cons avec sa couronne',
'source_author' => null]);
$this->fixture('Class_Notice',
['id' => 2,
'clef_oeuvre' => 'PSYKO',
]);
$this->fixture('Class_Notice',
['id' => 3,
'clef_oeuvre' => 'PSYKOTIC',
]);
$reviews = Class_AvisNotice::groupByRecords(Class_AvisNotice::findAll());
$reviews = array_map(function($review)
{
return (new Intonation_Library_View_Wrapper_ReviewsByRecord)
->setModel($review)
->setView($this->view);
}, $reviews);
$collection = new Storm_Collection($reviews);
$helper = (new Intonation_Library_AjaxPaginatedListHelper)
->setCollection($collection)
->setRendering('cardifyHorizontal');
$id = $helper->getId();
$this->dispatch('/opac/index/ajax-paginated-list/id/' . $id . '/page/2/render/ajax/id_profil/72/size/1/search/roi');
$this->assertContains('input_69219ce1da1a3a70c6511767a99d5a05', $this->_response->getBody());
$this->assertContains('avec sa couronne', $this->_response->getBody());
}
/** @test */
public function loansShouldContainsDrHouse() {
Storm_Cache::beVolatile();
......
Markdown is supported
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