From 75629734f01086d0b1e9ad75fdc665640a467db5 Mon Sep 17 00:00:00 2001 From: llaffont <llaffont@git-test.afi-sa.fr> Date: Fri, 17 Aug 2012 13:13:47 +0000 Subject: [PATCH] =?UTF-8?q?Les=20ic=C3=B4nes=20de=20la=20fiche=20abonn?= =?UTF-8?q?=C3=A9=20sont=20clicables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/ZendAfi/View/Helper/Abonne/Abstract.php | 6 +++--- library/ZendAfi/View/Helper/Abonne/Formations.php | 14 +++++++++----- library/ZendAfi/View/Helper/Abonne/Multimedia.php | 11 ++++++----- library/ZendAfi/View/Helper/Abonne/Newsletters.php | 6 ++++-- library/ZendAfi/View/Helper/Abonne/Paniers.php | 7 ++++--- library/ZendAfi/View/Helper/Abonne/Prets.php | 9 +++++---- .../ZendAfi/View/Helper/Abonne/Reservations.php | 8 +++++--- public/opac/css/global.css | 10 ++++++++-- .../AbonneControllerNewslettersTest.php | 2 +- 9 files changed, 45 insertions(+), 28 deletions(-) diff --git a/library/ZendAfi/View/Helper/Abonne/Abstract.php b/library/ZendAfi/View/Helper/Abonne/Abstract.php index 414dc28eeb1..a1bd37f6c77 100644 --- a/library/ZendAfi/View/Helper/Abonne/Abstract.php +++ b/library/ZendAfi/View/Helper/Abonne/Abstract.php @@ -19,9 +19,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ abstract class ZendAfi_View_Helper_Abonne_Abstract extends Zend_View_Helper_HtmlElement { - public function tagFicheAbonne($html, $icone='') { - if ($icone) - $html = $this->view->tagImg(URL_SHARED_IMG.'/abonnes/'.$icone.'.png', ['alt' => $icone]) . $html; + public function tagFicheAbonne($html, $icone, $url) { + $html = $this->view->tagAnchor($url, + $this->view->tagImg(URL_SHARED_IMG.'/abonnes/'.$icone.'.png', ['alt' => $icone]) . $html); return '<div class="abonneFiche">'.$html.'<div class="clear"></div></div>'; } } diff --git a/library/ZendAfi/View/Helper/Abonne/Formations.php b/library/ZendAfi/View/Helper/Abonne/Formations.php index b5d8aa30162..03bf4107cf7 100644 --- a/library/ZendAfi/View/Helper/Abonne/Formations.php +++ b/library/ZendAfi/View/Helper/Abonne/Formations.php @@ -23,14 +23,18 @@ class ZendAfi_View_Helper_Abonne_Formations extends ZendAfi_View_Helper_Abonne_A if (!Class_AdminVar::isFormationEnabled() || !$user->hasRightSuivreFormation()) return ''; - $html = $this->view->tagAnchor($this->view->url(['controller' => 'abonne', - 'action' => 'formations'], - null, - true), + $action_url = $this->view->url(['controller' => 'abonne', + 'action' => 'formations'], + null, + true); + + $html = $this->view->tagAnchor($action_url, $this->view->_("S'inscrire à une formation")); $html .= '<ul>'; + + foreach ($user->getSessionFormations() as $session) { $html .= sprintf('<li><a href="%s">%s, %s</li>', $this->view->url(['controller' => 'abonne', @@ -45,7 +49,7 @@ class ZendAfi_View_Helper_Abonne_Formations extends ZendAfi_View_Helper_Abonne_A $html .= '</ul>'; - return $this->tagFicheAbonne($html, 'formations'); + return $this->tagFicheAbonne($html, 'formations', $action_url); } } diff --git a/library/ZendAfi/View/Helper/Abonne/Multimedia.php b/library/ZendAfi/View/Helper/Abonne/Multimedia.php index c418316b058..5efb7af955a 100644 --- a/library/ZendAfi/View/Helper/Abonne/Multimedia.php +++ b/library/ZendAfi/View/Helper/Abonne/Multimedia.php @@ -23,10 +23,11 @@ class ZendAfi_View_Helper_Abonne_Multimedia extends ZendAfi_View_Helper_Abonne_A if (!Class_AdminVar::isMultimediaEnabled()) return ''; - $html = $this->view->tagAnchor($this->view->url(['controller' => 'abonne', - 'action' => 'multimedia-hold-location'], - null, - true), + $action_url = $this->view->url(['controller' => 'abonne', + 'action' => 'multimedia-hold-location'], + null, true); + + $html = $this->view->tagAnchor($action_url, $this->view->_("Réserver un poste multimédia")); $html .= '<ul>'; foreach ($user->getFutureMultimediaHolds() as $hold) { @@ -45,7 +46,7 @@ class ZendAfi_View_Helper_Abonne_Multimedia extends ZendAfi_View_Helper_Abonne_A $html .= '</ul>'; - return $this->tagFicheAbonne($html, 'multimedia'); + return $this->tagFicheAbonne($html, 'multimedia', $action_url); } } diff --git a/library/ZendAfi/View/Helper/Abonne/Newsletters.php b/library/ZendAfi/View/Helper/Abonne/Newsletters.php index 6d0e69fcb7f..01d7f77b629 100644 --- a/library/ZendAfi/View/Helper/Abonne/Newsletters.php +++ b/library/ZendAfi/View/Helper/Abonne/Newsletters.php @@ -33,11 +33,13 @@ class ZendAfi_View_Helper_Abonne_Newsletters extends ZendAfi_View_Helper_Abonne_ $newsletter_info .= implode(', ', $titres); } + $action_url = $this->view->url(['controller' => 'abonne', 'action' => 'edit']); return $this->tagFicheAbonne( '<p>'.$newsletter_info.'</p>'. - $this->view->tagAnchor(['controller' => 'abonne', 'action' => 'edit'], + $this->view->tagAnchor($action_url, $this->view->_('Modifier mes abonnements')), - 'newsletter'); + 'newsletter', + $action_url); } } diff --git a/library/ZendAfi/View/Helper/Abonne/Paniers.php b/library/ZendAfi/View/Helper/Abonne/Paniers.php index 95428c06136..4e2f0e98c77 100644 --- a/library/ZendAfi/View/Helper/Abonne/Paniers.php +++ b/library/ZendAfi/View/Helper/Abonne/Paniers.php @@ -28,11 +28,12 @@ class ZendAfi_View_Helper_Abonne_Paniers extends ZendAfi_View_Helper_Abonne_Abst "Vous avez %d paniers de notices", $nb_paniers); + $action_url = $this->view->url(['controller' => 'panier', 'action' => 'index']); return $this->tagFicheAbonne(sprintf('<a href=\'%s\'>%s</a>', - $this->view->url(['controller' => 'panier', - 'action' => 'index']), + $action_url, $str_paniers), - 'panier'); + 'panier', + $action_url); } } diff --git a/library/ZendAfi/View/Helper/Abonne/Prets.php b/library/ZendAfi/View/Helper/Abonne/Prets.php index de55e5be9a7..b84a2d70a97 100644 --- a/library/ZendAfi/View/Helper/Abonne/Prets.php +++ b/library/ZendAfi/View/Helper/Abonne/Prets.php @@ -34,13 +34,14 @@ class ZendAfi_View_Helper_Abonne_Prets extends ZendAfi_View_Helper_Abonne_Abstra $nb_retards = $fiche_sigb["fiche"]->getNbPretsEnRetard(); $str_retards = $nb_retards ? $this->view->_('(%d en retard)', $nb_retards) : ''; - + $action_url = $this->view->url(['controller' => 'abonne', + 'action' => 'prets']); return $this->tagFicheAbonne(sprintf('<a href=\'%s\'>%s %s</a>', - $this->view->url(['controller' => 'abonne', - 'action' => 'prets']), + $action_url, $str_prets, $str_retards), - 'prets'); + 'prets', + $action_url); } } diff --git a/library/ZendAfi/View/Helper/Abonne/Reservations.php b/library/ZendAfi/View/Helper/Abonne/Reservations.php index 9b6f740037b..061d1738cb7 100644 --- a/library/ZendAfi/View/Helper/Abonne/Reservations.php +++ b/library/ZendAfi/View/Helper/Abonne/Reservations.php @@ -31,11 +31,13 @@ class ZendAfi_View_Helper_Abonne_Reservations extends ZendAfi_View_Helper_Abonne "Vous avez %d réservations en cours", $nb_resas); + $action_url = $this->view->url(['controller' => 'abonne', + 'action' => 'reservations']); return $this->tagFicheAbonne(sprintf("<a href='%s'>%s</a>", - $this->view->url(['controller' => 'abonne', - 'action' => 'reservations']), + $action_url, $str_resas), - 'reservations'); + 'reservations', + $action_url); } } diff --git a/public/opac/css/global.css b/public/opac/css/global.css index d8e68ca5986..3cac32e5c34 100644 --- a/public/opac/css/global.css +++ b/public/opac/css/global.css @@ -1045,10 +1045,12 @@ body.abonne_multimedia-hold-view .actions a { .abonne_fiche .abonneFiche { - clear: both; padding-top: 10px; margin: 10px 10px 0px 10px; border-radius: 10px; + text-align: left; + float: left; + width: 45%; } .abonneTitre a img { @@ -1066,7 +1068,11 @@ body.abonne_multimedia-hold-view .actions a { .abonne_fiche .abonneFiche ul { - margin-left: 150px; + margin-left: 95px; +} + +.abonne_fiche .abonneFiche ul li { + list-style-type: disc; } diff --git a/tests/application/modules/opac/controllers/AbonneControllerNewslettersTest.php b/tests/application/modules/opac/controllers/AbonneControllerNewslettersTest.php index 5794e1c4213..7fd8c9e8d22 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerNewslettersTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerNewslettersTest.php @@ -142,7 +142,7 @@ class AbonneControllerFicheActionWithOneSubscriptionTest extends AbonneControlle public function testIconeNewsletterDisplayed () { - $this->assertXPath('//div[@class="abonneFiche"]//img[contains(@src, "abonnes/newsletter.png")]'); + $this->assertXPath('//div[@class="abonneFiche"]//a[contains(@href, "/abonne/edit")]//img[contains(@src, "abonnes/newsletter.png")]'); } -- GitLab