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

hotline #52395 fix link html in search result wall mode record toolbar

parent 23c44c83
Branches
Tags
3 merge requests!2080Sandbox detach zf from storm,!2061Master,!1967hotline #52395 fix link html in search result wall mode record toolbar
Pipeline #50 failed with stage
in 8 minutes and 4 seconds
- ticket #52395 : Résultat recherche mode mur : correction de l'affichage des liens
\ No newline at end of file
......@@ -74,39 +74,48 @@ class ZendAfi_View_Helper_ListeNotices_Mur extends ZendAfi_View_Helper_ListeNoti
protected function barreDeLien($notice){
$html =
$this->barreDeLienAvis($this->view->url(['controller'=>'noticeajax',
'action' => 'avis-abonne',
'id_notice' => $notice->getId()], null, true) . '?iframe=true',
$notice->numberOfAvisAbonne(),
$this->_('Avis des abonnés'))
. $this->barreDeLienAvis($this->view->url(['controller'=>'noticeajax',
'action' => 'avis-bibliothecaire',
'id_notice' => $notice->getId()], null, true) . '?iframe=true',
$notice->numberOfAvisBibliothecaire(),
$this->_('Coups de coeur'))
. $this->view->tag('li',
$this->view->tagAnchor($this->view->urlNotice($notice) .'#reseaux-sociaux',
' ',
['data-mur-partager' => $notice->getId(),
'title' => $this->view->_('Partager "%s" sur les réseaux sociaux',
$notice->getTitrePrincipal())]))
. $this->barreDeLienPanier($notice)
. $this->barreDeLienReserver($notice);
return
$this->_recordAvailability($notice)
. $this->_tag('ul',
$html,
['class' => 'barre-de-lien'])
. $this->view->reseauxSociaux($notice);
$html = [$this->_usersReviews($notice),
$this->_adminsReviews($notice),
$this->_socialNetwork($notice),
$this->barreDeLienPanier($notice),
$this->barreDeLienReserver($notice)];
return implode([$this->_recordAvailability($notice),
$this->_tag('ul', implode($html), ['class' => 'barre-de-lien']),
$this->view->reseauxSociaux($notice)]);
}
protected function barreDeLienReserver($notice) {
if ($notice->isRessourceNumerique() || $notice->isSite() || $notice->isArticleCms() || $notice->isRSS())
return '';
protected function _adminsReviews($record) {
return $this->barreDeLienAvis($this->view->url(['controller'=>'noticeajax',
'action' => 'avis-bibliothecaire',
'id_notice' => $record->getId()], null, true) . '?iframe=true',
$record->numberOfAvisBibliothecaire(),
$this->_('Coups de coeur'));
}
protected function _usersReviews($record) {
return $this->barreDeLienAvis($this->view->url(['controller'=>'noticeajax',
'action' => 'avis-abonne',
'id_notice' => $record->getId()], null, true) . '?iframe=true',
$record->numberOfAvisAbonne(),
$this->_('Avis des abonnés'));
}
protected function _socialNetwork($record) {
return $this->_tag('li', $this->view->tagAnchor($this->view->urlNotice($record) .'#reseaux-sociaux',
' ',
['data-mur-partager' => $record->getId(),
'title' => $this->view->_('Partager "%s" sur les réseaux sociaux',
$record->getTitrePrincipal())]));
}
protected function barreDeLienReserver($notice) {
$holdable = ($link = $this->view->Notice_LienReserver($notice))
? 'true'
: 'false';
......@@ -118,18 +127,23 @@ class ZendAfi_View_Helper_ListeNotices_Mur extends ZendAfi_View_Helper_ListeNoti
protected function barreDeLienAvis($url, $count, $title) {
if (!$count)
return '';
$html = $count
? $this->view->tagAnchor($url,
$this->_tag('span', $count),
['title' => $this->_('Voir les avis du document "%s"', $title)])
: '';
$attribs = $count
? ['data-avis' => 'true']
: [];
return $this->_tag('li',
$this->view->tagAnchor($url,
$this->_tag('span', $count),
['title' => $this->_('Voir les avis du document "%s"', $title)]),
['data-avis' => 'true']);
$html,
$attribs);
}
protected function barreDeLienPanier($notice) {
return $this->view->tag('li', $this->view->tagAddToCart($notice));
}
}
}
\ No newline at end of file
......@@ -22,6 +22,12 @@ class ZendAfi_View_Helper_Notice_LienReserver extends Zend_View_Helper_HtmlEleme
protected $_script_added = false;
public function Notice_LienReserver($notice) {
if ($notice->isRessourceNumerique()
|| $notice->isSite()
|| $notice->isArticleCms()
|| $notice->isRSS())
return '';
$this->loadScript();
$can_request_sigb = Class_AdminVar::isAfficherDispoSurRechercheEnabled();
$id_notice = $notice->getId();
......
......@@ -90,6 +90,12 @@ class ZendAfi_View_Helper_ListeNotices_MurForNoticeTest extends ZendAfi_View_Hel
}
/** @test */
public function linkBarShouldContains5lis() {
$this->assertXPathCount($this->_html, '//ul[@class="barre-de-lien"]/li', 5);
}
/** @test **/
public function noticeInModeMurShouldDisplayNouveaute() {
$this->assertXPathContentContains($this->_html,
......
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