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

Merge remote-tracking branch 'refs/remotes/origin/stable' into hotline-master

# Conflicts:
#	library/ZendAfi/View/Helper/Abonne/Loans.php
#	library/ZendAfi/View/Helper/Abonne/ReservationsTable.php
parents 224eddf5 3a16f61b
Branches
Tags
2 merge requests!2080Sandbox detach zf from storm,!2061Master
Pipeline #230 passed with stage
in 10 minutes and 8 seconds
......@@ -35,7 +35,7 @@ echo $extend_all;
if($this->user->hasPNB()) {
echo $this->tag('h2', $this->_('Prêts numériques en cours'));
echo $this->abonne_Loans($this->user->getPNBLoans());
echo $this->abonne_LoansPNB($this->user->getPNBLoans());
}
$this->closeBoite();
......
- ticket #36347 : Ajout de la colonne 'Support' dans la liste des prêts et des réservations. Amélioration du formatage de la liste des prêts PNB
\ No newline at end of file
......@@ -125,5 +125,10 @@ class Class_Loan_Pnb extends Storm_Model_Abstract {
public function getType() {
return '';
}
public function getIssueDate() {
return $this->getLoanDate();
}
}
?>
\ No newline at end of file
......@@ -42,7 +42,6 @@ class ZendAfi_View_Helper_Abonne_Loans extends ZendAfi_View_Helper_BaseHelper {
function($title) {
return $this->_tag('th', $title);
},
[$this->_('Emprunté par'),
$this->_('Titre'),
$this->_('Auteur'),
......@@ -56,6 +55,17 @@ class ZendAfi_View_Helper_Abonne_Loans extends ZendAfi_View_Helper_BaseHelper {
}
protected function _tableColumns() {
return [$this->_('n°'),
$this->_('Support'),
$this->_('Titre'),
$this->_('Auteur'),
$this->_in_progress ? $this->_('Bibliothèque') : $this->_('Date d\'emprunt'),
$this->_in_progress ? $this->_('Retour prévu') : $this->_('Date de retour'),
$this->_('Informations')];
}
protected function renderLoans($loans) {
$this->_line_no = 1;
$html = '';
......@@ -71,22 +81,24 @@ class ZendAfi_View_Helper_Abonne_Loans extends ZendAfi_View_Helper_BaseHelper {
protected function renderLoan($loan) {
$notice_url = $loan->getTitre();
if ($loan->getNoticeOPACId())
$notice_url = $this->view->tagAnchor($this->view->url(
['controller' => 'recherche',
'action' => 'viewnotice',
'id' => $loan->getNoticeOPACId(),
'retour_abonne' => 'prets'],
null, true),
$loan->getTitre());
$record_title = $loan->getTitre();
if ($record = $loan->getNoticeOPAC())
$record_title = $this->view->tagAnchor($this->view->url(
['controller' => 'recherche',
'action' => 'viewnotice',
'id' => $record->getId(),
'retour_abonne' => 'prets'],
null, true),
$loan->getTitre());
return
$this->_tag('tr',
$this->_tag('td',
$loan->getUserFullName())
. $this->_tag('td',
$notice_url)
$record ? $record->getTypeDocLabel() : '')
. $this->_tag('td',
$record_title)
. $this->_tag('td',
$loan->getAuteur())
. $this->_tag('td',
......
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Abonne_LoansPNB extends ZendAfi_View_Helper_Abonne_Loans {
public function abonne_LoansPNB($loans, $in_progress = true) {
return parent::abonne_Loans($loans, $in_progress);
}
protected function _tableColumns() {
return [$this->_('n°'),
$this->_('Titre'),
$this->_('Auteur'),
$this->_('Date d\'emprunt'),
$this->_in_progress ? $this->_('Retour prévu') : $this->_('Date de retour')];
}
protected function renderLoan($loan) {
$record_title = $loan->getTitre();
if ($record_id = $loan->getNoticeOPACId())
$record_title = $this->view->tagAnchor($this->view->url(
['controller' => 'recherche',
'action' => 'viewnotice',
'id' => $record_id,
'retour_abonne' => 'prets'],
null, true),
$loan->getTitre());
return
$this->_tag('tr',
$this->_tag('td',
$this->_line_no++)
. $this->_tag('td',
$record_title)
. $this->_tag('td',
$loan->getAuteur())
. $this->_tag('td',
date('d/m/Y', strtotime($loan->getIssueDate())))
. $this->_tag('td',
date('d/m/Y', strtotime($loan->getDateRetour())),
['class' => 'date_retour']));
}
}
\ No newline at end of file
......@@ -37,7 +37,9 @@ class ZendAfi_View_Helper_Abonne_ReservationsTable extends ZendAfi_View_Helper_B
return $this->_tag('th', $title);
},
[$this->_('Réservé par'),
$this->_('Support'),
$this->_('Titre'),
$this->_('Auteur'),
$this->_('Bibliothèque'),
......@@ -65,9 +67,12 @@ class ZendAfi_View_Helper_Abonne_ReservationsTable extends ZendAfi_View_Helper_B
protected function _renderReservation($reservation) {
$record = $reservation->getNoticeOPAC();
return
$this->_tag('tr',
$this->_tag('td', $reservation->getUserFullName())
. $this->_tag('td', $record ? $record->getTypeDocLabel() : '')
. $this->_tag('td',
$this->_getRecordLink($reservation->getTitre(), $reservation->getNoticeOPACId()))
. $this->_tag('td',
......
......@@ -124,6 +124,7 @@ abstract class AbonneControllerPretsListThreePretsTestCase extends AbstractAbonn
'notice' => $this->fixture('Class_Notice',
['id' => 889,
'titre_principal' => 'Potter',
'type_doc' => 1,
'unimarc' => '00577nam0 2200181 450 001001500000010001800015100004100033101000800074200010700082210003000189215001100219461002000230606002900250676000800279700004500287801005600332940000700388frOr1314913787 a9781408812792 a20140320 0103  aEng1 aHarry Potter and the deathly hallowsdHarry Potter et les reliques de la mortfJoanne Kathleen Rowling aLondrescBloomsburyd2010 a831 p. 1tHarry Potterv7 aAnglais (langue)2Rameau a420 1aRowlingbJoanne Kathleenf1965-....4070 aFRbBibliothèque de l\'agglomération de Saint-Omer apm'])]);
$alice = new Class_WebService_SIGB_Emprunt('13', new Class_WebService_SIGB_Exemplaire(456));
......@@ -141,6 +142,7 @@ abstract class AbonneControllerPretsListThreePretsTestCase extends AbstractAbonn
'notice' => $this->fixture('Class_Notice',
['id' => 827,
'titre_principal' => 'Alice',
'type_doc' => 1,
'unimarc' => '01175cam0 22002771 450 001001500000010003700015100004100052101000800093102000700101105001800108106000600126200009300132210002400225211001300249215006400262300002400326307002900350330027300379345001800652461005600670700001800726701003000744801003300774856008300807940000700890frOr0354235228 a978-2-35592-635-8bbr.d7,65 EUR a20140225d2014 | |0fre|0103||||ba afre aFR a 0||y| ar1 aAlice au royaume de TrèfleeCheshire cat Waltzh5fQuinRosegdessin Mamenosuke Fujimaru aPariscKi-oond2014 1a20140227 a1 vol. (164 p.)cillustrations en noir et blancd18 x 13 cm aTraduit du japonais aSens de lecture japonais aPerdue dans la forêt aux portes, Alice tombe nez à nez avec Ace. Devenue malgré elle la confidente du chevalier, elle ne sait comment repousser ses avances. Lorsque le chat du Cheshire, qui a assisté à la scène, intervient, la rencontre tourne à l\'affrontement. b9782355926358 1tAlice au royaume de Trèfle : Cheshire cat Waltzv5 1aQuinRose4070 1aFujimarubMamenosuke4440 aFRbElectrec20140225gAFNOR uhttp://www.electre.com//GetBlob.ashx?Ean=9782355926358,0-1913692&Size=Original aLR'])]);
$emprunteur = new Class_WebService_SIGB_Emprunteur('1234', 'Florence');
......@@ -151,6 +153,7 @@ abstract class AbonneControllerPretsListThreePretsTestCase extends AbstractAbonn
'subscriber_id' => $this->florence->getIdabon(),
'ongoing' => true,
'expected_return_date' => '2022-05-02T18:14:14+02:00',
'loan_date' => '2016-06-13T15:10:02+02:00',
'album' => $this->fixture('Class_Album',
['id' => 4,
'notice_id' => 5,
......@@ -164,6 +167,7 @@ abstract class AbonneControllerPretsListThreePretsTestCase extends AbstractAbonn
'user_id' => $this->florence->getId(),
'ongoing' => true,
'expected_return_date' => '2020-01-01T18:14:14+02:00',
'loan_date' => '2016-06-13T15:10:02+02:00',
'album' => $this->fixture('Class_Album',
['id' => 5,
'notice_id' => 6,
......@@ -327,8 +331,10 @@ class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListT
/** @test */
public function potterLoanShouldBePresent() {
$this->assertXPathContentContains("//tbody/tr[2]//td", 'Potter', $this->_response->getBody());
public function potterLoanShouldContainsTypeDocBook() {
$this->assertXPathContentContains('//tbody/tr[2]//td[preceding-sibling::td[text()="Livres"]]',
'Harry Potter and the deathly hallows',
$this->_response->getBody());
}
......@@ -380,21 +386,28 @@ class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListT
/** @test */
public function pinocchioPnbLoanShouldBePresent() {
$this->assertXPathContentContains('//tbody//a[contains(@href, "viewnotice/id/5")]',
'Pinocchio');
'Pinocchio',
$this->_response->getBody());
}
/** @test */
public function pnbLoansTableShouldNotDisplayTypeDoc() {
$this->assertXPath('//table//th[text()="Titre"][preceding-sibling::th[1][not(text()="Support")]]');
}
/** @test */
public function pinocchioPnbLoanReturnDateShouldBe2022() {
$this->assertXPathContentContains('//tbody//td[@class="date_retour"]',
'2022-05-02T18:14:14+02:00');
'02/05/2022');
}
/** @test */
public function peterPanPnbLoanReturnDateShouldBe2020() {
$this->assertXPathContentContains('//tbody//td[@class="date_retour"]',
'2020-01-01T18:14:14+02:00');
'01/01/2020');
}
}
......@@ -456,7 +469,8 @@ class AbonneControllerPretsListReservationTest extends AbstractAbonneControllerP
$this->fixture('Class_Notice',
['id' => 820,
'titre_principal' => 'Potter']);
'titre_principal' => 'Potter',
'type_doc' => Class_TypeDoc::DVD]);
$this->fixture('Class_Notice',
['id' => 824,
......@@ -541,6 +555,11 @@ class AbonneControllerPretsListReservationTest extends AbstractAbonneControllerP
}
/** @test */
public function typeDogShouldBeDVD() {
$this->assertXPathContentContains('//tbody/tr[1]//td', 'DVD');
}
/** @test */
public function etatShouldBeReservationEmise() {
$this->assertXPathContentContains('//tbody/tr[1]//td', 'Réservation émise');
......
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