Skip to content
Snippets Groups Projects
Commit f91a2300 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#72999_ajout_de_la_boite_bibliotheque' into 'hotline'

hotline #72999 fix library widget pagination links

See merge request !2572
parents 43f8bbed 039cae8b
Branches
Tags
4 merge requests!2660Master,!2586Master,!2585Hotline,!2572hotline #72999 fix library widget pagination links
Pipeline #3807 passed with stage
in 33 minutes and 26 seconds
- ticket #72999 : Boite bibliothèque : correction des liens de pagination.
\ No newline at end of file
......@@ -333,7 +333,8 @@ class ZendAfi_View_Helper_Accueil_Library extends ZendAfi_View_Helper_Accueil_Ba
'controller' => 'bib',
'action' => 'widget-page',
'id_module' => $this->id_module,
'id_division' => $this->division];
'id_division' => $this->division,
'render' => 'ajax'];
$paginator = (new Zend_Paginator(new Zend_Paginator_Adapter_Null(count($items))))
->setItemCountPerPage(max($items_by_page, 1))
......
......@@ -27,10 +27,10 @@
var url = node.attr(url_attr);
if (!url)
return event.preventDefault();
return event.preventDefault();
if (url == "#")
url = node.jqmData("href");
url = node.jqmData("href");
widget.load(url + "/render/ajax .boite > *", onLoadComplete);
event.preventDefault();
......@@ -40,7 +40,9 @@
var onLoadComplete = function() {
if ('onLoadComplete' in options)
options.onLoadComplete(widget);
initializePopups();
setupAnchorsTarget();
widget.ajaxifyFilters(options);
};
......
......@@ -73,8 +73,10 @@ abstract class ZendAfi_View_Helper_Accueil_LibraryTestCase extends ViewHelperTes
'division' => 2,
'preferences' => $preferences];
$this->view->setScriptPath('application/modules/opac/views/scripts');
$this->_helper = new ZendAfi_View_Helper_Accueil_Library(2, $params);
$this->_helper->setView(new ZendAfi_Controller_Action_Helper_View());
$this->_helper->setView($this->view);
$this->html = $this->_helper->getBoite();
}
......@@ -197,16 +199,18 @@ class ZendAfi_View_Helper_Accueil_LibraryAlphaOrderDisplayTest extends ZendAfi_V
class ZendAfi_View_Helper_Accueil_LibrarySelectionOrderDisplayTest extends ZendAfi_View_Helper_Accueil_LibraryTestCase {
class ZendAfi_View_Helper_Accueil_LibrarySelectionOrderDisplayTest
extends ZendAfi_View_Helper_Accueil_LibraryTestCase {
public function setUp() {
parent::setUp();
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Bib')
->whenCalled('findAllBy')
->with(['id_site' => ['4', '1', '2'],
'order' => 'FIELD (id_site, 4,1,2)'])
->answers([$this->meythet, $this->annecy, $this->cran])
->beStrict();
$this->onLoaderOfModel('Class_Bib')
->whenCalled('findAllBy')
->with(['id_site' => ['4', '1', '2'],
'order' => 'FIELD (id_site, 4,1,2)'])
->answers([$this->meythet, $this->annecy, $this->cran])
->beStrict();
$this->_generateLibrary(['titre' => 'Bibliotheques',
'libraries' => '4;1;2',
......@@ -283,7 +287,8 @@ class ZendAfi_View_Helper_Accueil_LibraryFieldsDisplayTest extends ZendAfi_View_
class ZendAfi_View_Helper_Accueil_LibraryCustomFieldsDisplayTest extends ZendAfi_View_Helper_Accueil_LibraryTestCase {
class ZendAfi_View_Helper_Accueil_LibraryCustomFieldsDisplayTest
extends ZendAfi_View_Helper_Accueil_LibraryTestCase {
public function setUp() {
parent::setUp();
......@@ -362,3 +367,23 @@ class ZendAfi_View_Helper_Accueil_LibraryCustomFieldsDisplayTest extends ZendAfi
$js);
}
}
class ZendAfi_View_Helper_Accueil_LibraryPaginatorTest
extends ZendAfi_View_Helper_Accueil_LibraryTestCase {
public function setUp() {
parent::setUp();
$this->_generateLibrary(['titre' => 'Bibliotheques',
'libraries' => '4;1;2',
'nb_aff' => 1]);
}
/** @test */
public function linkToPage2ShouldBeRenderAjax() {
$this->assertXPathContentContains($this->html, '//div[@class="paginationControl"]//a[contains(@href, "/render/ajax")]', '2');
}
}
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