Commit 773b3117 authored by Arthur Suzuki's avatar Arthur Suzuki
Browse files

hotline MT #138657 fix selection link in user search administration

parent 2a7af482
- ticket #138657 : Administration : correction du lien d'accès aux paniers dans la liste des utilisateurs dans le contexte du magasin de thèmes.
\ No newline at end of file
<?php
$this->openBoite($this->_('Les paniers de %s',$this->name));
echo $this->tag('span',
$this->_plural(count($this->paniers),
"Il n\'y a aucun panier.",
"Il y a %d panier",
"Il y a %d paniers",
count($this->paniers)),
['class' => 'abonne',
'id' => 'abonne_erreur']);
$panier_domain = $this->tagAnchor($this->url(['controller' => 'panier',
'action' => 'domain'], null ,true),
$this->_('Voir les paniers rangés dans des domaines'),
['class' => 'bouton']);
$panier_pro = $this->tagAnchor($this->url(['controller' => 'panier',
'action' => 'pro'], null ,true),
$this->_('Voir les paniers des professionnels'),
['class' => 'bouton']);
echo $this->tag('div', $panier_domain . $panier_pro);
echo $this->panier_Table($this->paniers, [], [], [], 2);
if($this->erreur)
echo $this->tag('script', sprintf('alert("%s")', $this->erreur));
$this->closeBoite();
?>
echo $this->Panier_Viewauteur($this->name, $this->paniers);
<?php
/**
* Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Panier_Viewauteur extends ZendAfi_View_Helper_BaseHelper {
public function Panier_Viewauteur($name, $paniers) {
$html = [$this->view->openBoiteContent($this->_('Les paniers de %s',$name)),
$this->_tag('span',
$this->_plural(count($paniers),
"Il n\'y a aucun panier.",
"Il y a %d panier",
"Il y a %d paniers",
count($paniers)),
['class' => 'abonne',
'id' => 'abonne_erreur'])];
$panier_domain = $this->view->tagAnchor($this->view->url(['controller' => 'panier',
'action' => 'domain'], null ,true),
$this->_('Voir les paniers rangés dans des domaines'),
['class' => 'bouton']);
$panier_pro = $this->view->tagAnchor($this->view->url(['controller' => 'panier',
'action' => 'pro'], null ,true),
$this->_('Voir les paniers des professionnels'),
['class' => 'bouton']);
$html [] = $this->_tag('div', $panier_domain . $panier_pro);
$html [] = $this->view->panier_Table($paniers, [], [], [], 2);
if($this->view->erreur)
$html [] = $this->_tag('script', sprintf('alert("%s")', $this->view->erreur));
$html [] = $this->view->closeBoiteContent();
return implode($html);
}
}
......@@ -166,6 +166,7 @@ abstract class Intonation_System_Abstract {
if($this->isVisibleForUserController()) {
$controllers [] = 'abonne';
$controllers [] = 'panier';
$controllers [] = 'drive-checkout';
}
......
<?php
/**
* Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Intonation_View_Panier_Viewauteur extends ZendAfi_View_Helper_BaseHelper {
public function Panier_Viewauteur($name, $paniers) {
$this->view->titre = $this->_('Les sélections de %s', $name);
return $this->view->abonne_Selections($paniers);
}
}
......@@ -47,7 +47,7 @@ class Intonation_View_SocialNetworksActions extends ZendAfi_View_Helper_ReseauxS
public function links($info_to_share) {
$this->shareLinkHtmlHeader($info_to_share);
$this->_actions [] = $this->view->permalink($this->view->absoluteUrl($info_to_share['url_to_share']));
$this->_actions [] = $this->view->Template_Permalink($this->view->absoluteUrl($info_to_share['url_to_share']));
return '';
}
}
......@@ -18,9 +18,9 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Intonation_View_Permalink extends ZendAfi_View_Helper_BaseHelper {
class Intonation_View_Template_Permalink extends ZendAfi_View_Helper_BaseHelper {
public function permalink($url) {
public function Template_Permalink($url) {
return (new Intonation_Library_Link)
->setText($this->_('Lien …'))
->setImage($this->view->templateIco('permalink', 'utils'))
......
......@@ -71,6 +71,36 @@ abstract class TemplatesAbonneSelectionsTestCase extends TemplatesIntonationTest
class TemplatesAbonneShowUserCartAsAdminTest extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->_buildTemplateProfil(['id' => 2]);
$admin = Class_Users::newInstanceWithId('123456',['nom'=>'Zozor'])->beAdminPortail();
$this->fixture(Class_PanierNotice::class,
['id' => 67,
'libelle' => 'Zozor sélection',
'id_user' => 123456]);
$this->dispatch('/opac/panier/viewauteur/id/123456');
}
/** @test */
public function shouldRenderZozorSelection() {
$this->assertXPathContentContains('//body[contains(@class, "template_INTONATION")]//div[contains(@class,"card-title")]//a[contains(@href, "id_panier/67")]', 'Zozor sélection');
}
}
class TemplatesAbonneSelectionsAsAbonneTest extends TemplatesAbonneSelectionsTestCase {
public function setUp() {
parent::setUp();
......
Markdown is supported
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