Skip to content
Snippets Groups Projects
Commit 838e10c3 authored by gloas's avatar gloas
Browse files

correction ajout panier ajax : script opacDialogClose shoud be present

parent 1eec2084
Branches
Tags
No related merge requests found
...@@ -8,8 +8,9 @@ if($this->id_module){ ...@@ -8,8 +8,9 @@ if($this->id_module){
$url_reload = $this->absoluteUrl(['controller' => 'modules-accueil', $url_reload = $this->absoluteUrl(['controller' => 'modules-accueil',
'action' => 'render-module', 'action' => 'render-module',
'id' => $this->id_module],null,true); 'id' => $this->id_module],null,true);
echo "<script>$('.boite.panier').reload('".$url_reload."');opacDialogClose();</script>"; echo "<script>$('.boite.panier').reload('".$url_reload."');</script>";
} }
echo "<script>opacDialogClose();<script>";
?> ?>
<div class="ajout-result"><span><?php echo $this->_('La notice ').$this->notice->getTitrePrincipal().$this->_(' a bien été ajoutée au panier ').$this->panier->getLibelle(); ?></span> <div class="ajout-result"><span><?php echo $this->_('La notice ').$this->notice->getTitrePrincipal().$this->_(' a bien été ajoutée au panier ').$this->panier->getLibelle(); ?></span>
<a href="<?php echo $urlPanier;?>#panier_contenu"><?php echo $this->_('Voir le panier'); ?></a> <a href="<?php echo $urlPanier;?>#panier_contenu"><?php echo $this->_('Voir le panier'); ?></a>
......
...@@ -1218,10 +1218,10 @@ class PanierControllerAjoutAjaxSuccessTest extends PanierControllerSimpleLoggedU ...@@ -1218,10 +1218,10 @@ class PanierControllerAjoutAjaxSuccessTest extends PanierControllerSimpleLoggedU
/** @test **/ /** @test **/
public function responseShouldContainsScriptBoitePanierReload() { public function responseShouldContainsScriptOpacDialogClose() {
$this->dispatch('/panier/ajout-ajax-success/id_notice/12/id_panier/39',true); $this->dispatch('/panier/ajout-ajax-success/id_notice/12/id_panier/39',true);
$this->_json = json_decode($this->_response->getbody()); $this->_json = json_decode($this->_response->getbody());
$this->_xpath->assertXPath($this->_json->content,'//div[@class="ajout-result"]'); $this->_xpath->assertXPathContentContains($this->_json->content,'//script','opacDialogClose()');
} }
......
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