Skip to content
Snippets Groups Projects
Commit 75629734 authored by llaffont's avatar llaffont
Browse files

Les icônes de la fiche abonné sont clicables

parent 37141b66
Branches
Tags
No related merge requests found
......@@ -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>';
}
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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;
}
......
......@@ -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")]');
}
......
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