diff --git a/VERSIONS_HOTLINE/93294 b/VERSIONS_HOTLINE/93294 new file mode 100644 index 0000000000000000000000000000000000000000..9457ff03be2b6b81437b2d2df7dc85feb4fccb6c --- /dev/null +++ b/VERSIONS_HOTLINE/93294 @@ -0,0 +1 @@ + - ticket #93294 : Compte lecteur : Correction des paginations multiples sur les prêts \ No newline at end of file diff --git a/library/Class/Profil/Preferences/Loans.php b/library/Class/Profil/Preferences/Loans.php index b37c8bdce8572e75a2c66e2d2ebcc39360ab91c6..d5b4ee267577cec68285c1b1e4fad80314ca57ad 100644 --- a/library/Class/Profil/Preferences/Loans.php +++ b/library/Class/Profil/Preferences/Loans.php @@ -46,7 +46,7 @@ class Class_Profil_Preferences_Loans { public function getToolsComposition($value) { return (new Class_Entity(['Id' => 'tools_composition', 'AvailableHeader' => $this->_('Outils disponibles'), - 'SelectedHeader' => $this->_('Outils activées'), + 'SelectedHeader' => $this->_('Outils activés'), 'Available' => $this->_getAvailablesTools($value), 'Selected' => $this->_getSelectedTools($value)])); } diff --git a/library/Class/ScriptLoader.php b/library/Class/ScriptLoader.php index b9968a0b3da9cd6496c4f069aca0eed7d0d856c7..692bb96391f2406b8f434d715074a1591020ba80 100644 --- a/library/Class/ScriptLoader.php +++ b/library/Class/ScriptLoader.php @@ -711,18 +711,20 @@ class Class_ScriptLoader { /** * @return ScriptLoader */ - public function loadTableSorter($pager = false) { + public function loadTableSorter($pager = false, + $table_selector = '.tablesorter', + $pager_selector = '.model_table_pager') { $this ->addOPACScript('tablesorter/js/jquery.tablesorter.min') ->addStyleSheet(BASE_URL."/public/opac/js/tablesorter/css/theme.default.css") - ->addJQueryReady('$(".tablesorter").tablesorter()'); + ->addJQueryReady('$("' . $table_selector . '").tablesorter()'); if ($pager) $this ->addOPACScript('tablesorter/addons/pager/jquery.tablesorter.pager.min') ->addStyleSheet(BASE_URL."/public/opac/js/tablesorter/addons/pager/jquery.tablesorter.pager.css") - ->addJQueryReady('$(".tablesorter").tablesorterPager({container: $(".model_table_pager"),output: "{startRow} - {endRow} / {totalRows} ",fixedHeight: true})'); + ->addJQueryReady('$("' . $table_selector . '").tablesorterPager({container: $("' . $pager_selector . '"),output: "{startRow} - {endRow} / {totalRows} ",fixedHeight: true})'); return $this; } diff --git a/library/ZendAfi/View/Helper/RenderTable.php b/library/ZendAfi/View/Helper/RenderTable.php index 344cf9e13b91c4671786fadbac68f78596a88a28..932d377154330b214c4be02c3fffc81d6e5eb5f9 100644 --- a/library/ZendAfi/View/Helper/RenderTable.php +++ b/library/ZendAfi/View/Helper/RenderTable.php @@ -34,7 +34,9 @@ class ZendAfi_View_Helper_RenderTable extends ZendAfi_View_Helper_BaseHelper { if($description->isSorterClient()) { $classes [] = 'tablesorter'; - Class_ScriptLoader::getInstance()->loadTableSorter($description->getPager()); + Class_ScriptLoader::getInstance()->loadTableSorter($description->getPager(), + '#' . $description->getId(), + '.' . $this->_getPagerClass($description)); } $classes = array_merge($classes, $description->getClasses()); @@ -53,6 +55,11 @@ class ZendAfi_View_Helper_RenderTable extends ZendAfi_View_Helper_BaseHelper { } + protected function _getPagerClass($description){ + return 'pager_' . $description->getId(); + } + + protected function _head($description) { return $this->view->renderTable_Header($description); } @@ -98,7 +105,7 @@ class ZendAfi_View_Helper_RenderTable extends ZendAfi_View_Helper_BaseHelper { $form = $this->_tag('form', $html); - return $this->_tag('div', $form, ['class' => 'pager model_table_pager']); + return $this->_tag('div', $form, ['class' => 'pager model_table_pager '. $this->_getPagerClass($description)]); } } diff --git a/tests/application/modules/opac/controllers/AbonneControllerLoansHistoryNanookTest.php b/tests/application/modules/opac/controllers/AbonneControllerLoansHistoryNanookTest.php index e445867f63aba0b44268ef3669a6cb981a794bdb..cd738b311247f8a70c2223c17e400e3571119434 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerLoansHistoryNanookTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerLoansHistoryNanookTest.php @@ -137,7 +137,7 @@ class AbonneControllerLoansHistoryNanookIndexTest extends AbonneControllerLoansH /** @test */ public function paginatorShouldBePresent() { - $this->assertXPath('//div[@class="pager model_table_pager"]'); + $this->assertXPath('//div[contains("pager model_table_pager",@class)]'); } } diff --git a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php index dc8b18f4cfa89b8d3fe1d153da00b44c8f025da7..867721c7380e8e6fb336a72c598df3bbf016a106 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php @@ -288,7 +288,7 @@ class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListT (new Class_Entity()) ->setController('abonne') ->setAction('prets'), - ['tools_composition' => 'search_tool;export_barcodes;export_unimarc;extend_all;print']); + ['tools_composition' => 'pager;search_tool;export_barcodes;export_unimarc;extend_all;print']); $this->dispatch('/opac/abonne/prets', true); } @@ -337,7 +337,7 @@ class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListT /** @test */ public function tableShouldHaveClassTableSorter() { - $this->assertXPath('//table[@class="models tablesorter loans"]', $this->_response->getBody()); + $this->assertXPath('//table[@class="models tablesorter loans"][@id="borrower_loans"]', $this->_response->getBody()); } @@ -345,7 +345,32 @@ class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListT public function tableSorterShouldBeLoaded() { $this->assertXPath('//script[contains(@src, "tablesorter.min")]'); $this->assertXPath('//link[contains(@href, "tablesorter/css/theme.default.css")]'); - $this->assertXPathContentContains('//script', '$(".tablesorter").tablesorter()'); + $this->assertXPathContentContains('//script', '$("#borrower_loans").tablesorter()'); + } + + +/** @test */ + public function pageShouldLoadPagerScriptOnClassPagerBorrowerLoans() { + $this->assertXPathContentContains('//script','$("#borrower_loans").tablesorterPager({container: $(".pager_borrower_loans"),output:',$this->_response->getBody()); + } + + +/** @test */ + public function pageShouldContainsTwoPagersForBorrowerLoans() { + $this->assertXPathCount('//div[@class="pager model_table_pager pager_borrower_loans"]',2, $this->_response->getBody()); + } + + +/** @test */ + public function tableSorterForPnbShouldBeLoaded() { + $this->assertXPathContentContains('//script', '$("#borrower_loans_pnb").tablesorter()'); + } + + + + /** @test */ + public function pageShouldContainsTwoPagersForBorrowerLoansPNB() { + $this->assertXPathCount('//div[@class="pager model_table_pager pager_borrower_loans_pnb"]',2, $this->_response->getBody()); } @@ -464,13 +489,6 @@ class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListT $this->assertXPathContentContains('//tbody//td[@class="date_retour"]', '02/05/2022'); } - - - /** @test */ - public function peterPanPnbLoanReturnDateShouldBe2020() { - $this->assertXPathContentContains('//tbody//td[@class="date_retour"]', - '01/01/2020'); - } } diff --git a/tests/library/Class/WebService/LastfmTest.php b/tests/library/Class/WebService/LastfmTest.php index 32c6f89d6d96d4ffe1f3103fc89e6b7a2e759942..09b96a4afb5c8713c0995c3556b8e281a9a6b235 100644 --- a/tests/library/Class/WebService/LastfmTest.php +++ b/tests/library/Class/WebService/LastfmTest.php @@ -117,6 +117,9 @@ class LastFmGetMorceauxUnpluggedClaptonIntegrationTest extends ModelTestCase { class LastfmGetPhotosRageAgainstTheMachineTest extends ModelTestCase { + protected $_storm_default_to_volatile = true; + + public function setUp() { parent::setUp(); $lastfm = new Class_WebService_Lastfm(); diff --git a/tests/scenarios/HandleOnholdTest/HandleOnholdTest.php b/tests/scenarios/HandleOnholdTest/HandleOnholdTest.php index 5f7712528f9ae3a9bafb300734a207f90414b3de..f6e5818d35c9529a2623c76ca81ceec86c3a5a00 100644 --- a/tests/scenarios/HandleOnholdTest/HandleOnholdTest.php +++ b/tests/scenarios/HandleOnholdTest/HandleOnholdTest.php @@ -246,7 +246,7 @@ abstract class HandleOnholdDispatchTestCase extends HandleOnholdTestCase { /** @test */ public function pagerShouldBeDisplay() { $this->dispatch('/opac/abonne/prets/onhold/yes', true); - $this->assertXPath('//div[@class="pager model_table_pager"]'); + $this->assertXPath('//div[contains("pager model_table_pager",@class)]'); } } diff --git a/tests/scenarios/PnbDilicom/PnbDilicomTest.php b/tests/scenarios/PnbDilicom/PnbDilicomTest.php index 3cd2f52aa99fcb829847ac83786bde61836a137d..4750bd9a730699bfe18b4d990143e0f02ee57f7e 100644 --- a/tests/scenarios/PnbDilicom/PnbDilicomTest.php +++ b/tests/scenarios/PnbDilicom/PnbDilicomTest.php @@ -3177,8 +3177,8 @@ class PnbDilicomAdminAlbumControllerImportDilicomPaginatorTest extends PnbDilico /** @test */ - public function contextShouldExpectation() { - $this->assertXPathContentContains('//div[@class="pager model_table_pager"]', '1', $this->_response->getBody()); + public function pageShouldContainsPager() { + $this->assertXPathContentContains('//div[contains(@class,"pager model_table_pager")]', '1', $this->_response->getBody()); }