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

Merge branch 'dev#87935_fonction_plan_d_acces_tableau_exemplaire' into 'master'

Dev#87935 fonction plan d acces tableau exemplaire

See merge request !3046
parents a193b1bb a04641be
Branches
Tags
2 merge requests!3297WIP: Master,!3046Dev#87935 fonction plan d acces tableau exemplaire
Pipeline #6499 failed with stage
in 29 minutes and 15 seconds
- ticket #87935 : Tableau des exemplaires : amélioration de la colonne plan d'accès.
\ No newline at end of file
......@@ -3,7 +3,7 @@
<ul data-role="listview">
<li data-role="list-divider"><?php echo $this->_('Coordonnées')?></li>
<li>
<div style="float:left"><?php echo $this->mapForLieu($this->bib->getLieu(),
<div style="float:left"><?php echo $this->mapForLieu($this->bib->answersLocation(),
array('size' => '100x100')); ?></div>
<address>
<?php echo nl2br($this->bib->getAdresse());?><br>
......@@ -23,4 +23,4 @@
<?php echo nl2br(urldecode($this->bib->getHoraire()));?>
</li>
<?php } ?>
</lu>
\ No newline at end of file
</lu>
......@@ -363,8 +363,8 @@ class Class_Bib extends Storm_Model_Abstract {
}
public function getLieu() {
if ($lieu = parent::_get('lieu'))
public function answersLocation() {
if ($lieu = $this->getLieu())
return $lieu;
return Class_Lieu::getLoader()
......@@ -963,15 +963,11 @@ class Class_Bib extends Storm_Model_Abstract {
public function getLatitude() {
return $this->hasLieu()
? $this->getLieu()->getLatitude()
: null;
return $this->answersLocation()->getLatitude();
}
public function getLongitude() {
return $this->hasLieu()
? $this->getLieu()->getLongitude()
: null;
return $this->answersLocation()->getLongitude();
}
}
......@@ -367,14 +367,17 @@ class ZendAfi_View_Helper_Notice_Exemplaires_Plan extends ZendAfi_View_Helper_No
protected function _getMapLink($exemplaire) {
if (!$this->getBib($exemplaire)->getGoogleMap())
return '&nbsp;';
if (!$bib = $this->getBib($exemplaire))
return '';
if (!$bib->hasLieu())
return '';
return $this->view->tagAnchor($this->view->url(['controller' => 'bib',
'action' => 'mapview',
'id_bib' => $exemplaire->getIdBib(),
'retour' => 'notice'], null, true),
$this->_getPicto());
'id_bib' => $exemplaire->getIdBib()], null, true),
$this->_getPicto(),
['data-popup' => true]);
}
......
......@@ -33,11 +33,12 @@ abstract class NoticeAjaxControllerItemsTestCase extends AbstractControllerTestC
$this->fixture('Class_Bib',
['id' => 3,
'google_map' => 1,
'lieu' => $this->fixture('Class_Lieu',
['id' => 3,
'libelle' => 'Lunel']),
'localisations' => [$this->fixture('Class_Localisation',
['id' => 43])]]);
$itemA = $this->fixture('Class_Exemplaire',
['id' => 12,
'id_bib' => 3,
......@@ -151,6 +152,12 @@ class NoticeAjaxControllerItemsWithoutOrderTest
$this->assertXPathContentOrder('//td[@class="cote"]',
['A', 'B', 'C']);
}
/** @test */
public function linkToMapviewShouldBePresent() {
$this->assertXPath('//td//a[contains(@href, "/bib/mapview/id_bib/3")][@data-popup="1"]');
}
}
......
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