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

Merge branch 'hotline_#16454_booking_issues_on_embed' into 'hotline_6.54'

Hotline #16454 booking issues on embed

See merge request !469
parents 76c3986e f18a81e4
Branches
Tags
4 merge requests!529Hotline 6.56,!512Master,!484Master,!483Hotline 6.54
- ticket: #16454: add 'code annexe' to booking in request in embed mode to fix booking issue
\ No newline at end of file
<?php
echo $this->toolbar($this->_("Exemplaires"),
array('action' => 'viewnotice'),
echo $this->toolbar($this->_("Exemplaires"),
array('action' => 'viewnotice'),
false);
?>
<h1><?php echo $this->escape($this->notice->getTitrePrincipal());?></h1>
<?php
if (0 == count($exemplaires = $this->notice->getExemplaires()))
<?php
if (0 == count($exemplaires = $this->notice->getExemplaires()))
echo $this->_('Aucun exemplaire.');
$num = 0;
......@@ -19,32 +19,32 @@ foreach ($exemplaires as $exemplaire) {
<li class="ui-li ui-li-static ui-body-c ui-corner-top">
<div><?php echo $this->_('n°') . ' ' . ++$num;?></div>
<dl>
<?php
<?php
if ($this->preferences_exemplaires['bib'])
echo sprintf($dt_dd,
$this->_('Bibliothèque'),
echo sprintf($dt_dd,
$this->_('Bibliothèque'),
$this->escape($exemplaire->getBib()->getLibelle()));
if ($this->preferences_exemplaires['annexe'] && ($annexe = $exemplaire->getCodifAnnexe()))
echo sprintf($dt_dd,
$this->_('Bibliothèque'),
echo sprintf($dt_dd,
$this->_('Bibliothèque'),
$this->escape($annexe->getLibelle()));
if ($cote = $exemplaire->getCote())
echo sprintf($dt_dd,
$this->_('Cote'),
echo sprintf($dt_dd,
$this->_('Cote'),
$this->escape($cote));
if ($this->preferences_exemplaires['dispo'])
echo sprintf($dt_dd,
$this->_('Disponibilite'),
echo sprintf($dt_dd,
$this->_('Disponibilite'),
$sigb_exemplaire ? $sigb_exemplaire->getDisponibilite() : $this->_('non connue'));
$date_retour = $sigb_exemplaire ? $sigb_exemplaire->getDateRetour() : null;
if ($this->preferences_exemplaires['date_retour'] && (null != $date_retour))
echo sprintf($dt_dd,
$this->_('Date de retour'),
echo sprintf($dt_dd,
$this->_('Date de retour'),
$date_retour);
?>
</dl>
......@@ -53,25 +53,26 @@ foreach ($exemplaires as $exemplaire) {
<li class="ui-li ui-li-static ui-body-c ui-corner-bottom">
<div class="ui-grid-a">
<div class="ui-block-a">
<a href="<?php
<a href="<?php
echo $this->url(array('controller' => 'recherche',
'action' => 'bibliotheque',
'id' => $exemplaire->getBib()->getId()),
null, true);?>"
null, true);?>"
data-role="button" data-mini="true" data-icon="info"><?php echo $this->_('Horaires');?></a>
</div>
<div class="ui-block-b">
<?php
<?php
if (Class_AdminVar::isPackMobileEnabled()
&& (!$exemplaire->getBib()->getInterdireResa())
&& $sigb_exemplaire
&& $sigb_exemplaire->isReservable()) { ?>
<a href="<?php
<a href="<?php
$annexe = $sigb_exemplaire->getCodeAnnexe() ? $sigb_exemplaire->getCodeAnnexe() : $exemplaire->getAnnexe();
echo $this->url(array('controller' => 'recherche',
'action' => 'reservation',
'b' => $exemplaire->getBib()->getId(),
'e' => $exemplaire->getId(),
'a' => $sigb_exemplaire->getCodeAnnexe()),
'a' => $annexe),
null, true);?>"
data-role="button" data-mini="true" data-icon="arrow-r"
data-iconpos="right" data-ajax="false" rel="external"><?php echo $this->_('Réserver');?></a>
......
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once 'TelephoneAbstractControllerTestCase.php';
......@@ -29,7 +29,7 @@ class Telephone_RechercheControllerSimpleSeveralInexistingWordsActionTest extend
}
/** @test */
public function expressionRechercheShouldBeDisplayed() {
$this->assertXPathContentContains('//span', 'zzriuezz greuieub brfauiok',$this->_response->getBody());
......@@ -60,7 +60,7 @@ class Telephone_RechercheControllerSimpleSeveralInexistingWordsActionTest extend
class Telephone_RechercheControllerSimpleOneInexistingWordActionTest extends TelephoneAbstractControllerTestCase {
public function setUp() {
parent::setUp();
$this->postDispatch('/telephone/recherche/simple',
$this->postDispatch('/telephone/recherche/simple',
array('expressionRecherche' => 'zzriuezz'));
}
......@@ -159,7 +159,7 @@ class Telephone_RechercheControllerBibliothequeActionTest extends TelephoneAbstr
$this->assertXPathContentContains('//li', 'Tous les jours');
}
}
class Telephone_RechercheControllerFrbrWithLinksTest extends TelephoneAbstractControllerTestCase {
private $_tintinPicaros;
......@@ -167,7 +167,7 @@ class Telephone_RechercheControllerFrbrWithLinksTest extends TelephoneAbstractCo
public function setUp(){
parent::setUp();
$tintinReporter = 'HERGEETTINTINREPORTERS-DUPETITVINGTIEMEAUJO-GODDINP--EDITIONSDULOMBARD-1986-1';
$this->_tintinPicaros = 'TINTINEIPICAROS--HERGE--LIZARD-2001-1';
$this->_tintinAventure = 'THEADVENTUREOFTINTIN-CIGARSOFTHEPHARAOH-HERGE--USBORNE-2009-1';
......@@ -257,4 +257,52 @@ class Telephone_RechercheControllerFrbrWithLinksTest extends TelephoneAbstractCo
}
}
class Telephone_RechercheControllerReservationNemoInfoTest extends TelephoneAbstractControllerTestCase {
public function setUp() {
parent::setUp();
$bib = $this->fixture('Class_Bib',
['id' => 1,
'libelle' => 'My Bib',
'interdire_resa' => 0]);
$this->fixture('Class_IntBib',
['id' => 1]);
Class_Profil::getCurrentProfil()
->setCfgNotice(['exemplaires' => ['bib' => 1,
'annexe' => 1,
'section' => 1,
'emplacement' => 1,
'dispo' => 1,
'date_retour' => 1,
'resa' => 1]]);
$nemo = $this->fixture('Class_Notice',
['id' => 1,
'clef_alpha' => 'NEMO',
'titre_principal' => 'Nemo']);
$nemo_item_sigb = new Class_WebService_SIGB_Exemplaire(1);
$nemo_item_sigb->beReservable();
$nemo_item = $this->fixture('Class_Exemplaire',
['id' => 1,
'sigb_exemplaire' => $nemo_item_sigb,
'bib' => $bib,
'cote' => 123,
'annexe' => 'PLOP']);
$nemo->setExemplaires([$nemo_item])->save();
$this->dispatch('/telephone/recherche/exemplaires/id/1', true);
}
/** @test */
public function annexeParamShouldBePresent() {
$this->assertXPath('//a[contains(@href,"/recherche/reservation/b/1/e/1/a/PLOP")]', $this->response->getBody());
}
}
?>
\ No newline at end of file
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