diff --git a/application/modules/opac/controllers/AbonneController.php b/application/modules/opac/controllers/AbonneController.php index 728b800f3730ba1d7ad36105dd149b4440feea62..140793bb62a8f261b02be0dcfafc97e73e505086 100644 --- a/application/modules/opac/controllers/AbonneController.php +++ b/application/modules/opac/controllers/AbonneController.php @@ -952,16 +952,12 @@ class AbonneController extends ZendAfi_Controller_Action { public function getPaniersJsonAction() { - $this->_helper->viewRenderer->setNoRender(); - - $data = []; $data[] = $this->_user->getPaniersJson(); + if ($this->_user->canAccessBackend()) $data[] = (new Class_Catalogue())->getDomainesJson(['removeCheckbox' => true]); - $JSON = json_encode($data); - $this->getResponse()->setHeader('Content-Type', 'application/json; charset=utf-8'); - $this->getResponse()->setBody($JSON); + $this->_helper->json($data); } diff --git a/application/modules/opac/controllers/PanierController.php b/application/modules/opac/controllers/PanierController.php index 5399b94a0b788f1242ef9dfdf7e4fc6ac93a8183..afb13192de98f8d2205f59f14cbfeeb7014250aa 100644 --- a/application/modules/opac/controllers/PanierController.php +++ b/application/modules/opac/controllers/PanierController.php @@ -35,24 +35,41 @@ class PanierController extends ZendAfi_Controller_Action { public function indexAction() { - $panier_courant = Class_PanierNotice::find($this->_getParam("id_panier", 0)); + $panier = Class_PanierNotice::find($this->_getParam("id_panier", 0)); - if (!$this->_user->canModifyPanier($panier_courant)) + if($panier && $this->_user->isPanierPro($panier)) + return $this->_forward('domain'); + + $this->_indexJob($panier, $this->_user->getPaniers()); + } + + + public function domainAction() { + $panier = Class_PanierNotice::find($this->_getParam("id_panier", 0)); + $this->_indexJob($panier, Class_PanierNotice::findAllWithCatalogue()); + } + + + public function proAction() { + $this->_indexJob(null, Class_PanierNotice::findAllBelongsToAdmin()); + } + + + protected function _indexJob($panier, $paniers) { + if (!$this->_user->canModifyPanier($panier)) return $this->_redirect('opac/panier'); - $paniers = $this->_user->getPaniers(); + if($panier && $this->_user->getPanierCourant() != $panier) + $this->_user->setPanierCourant($panier); $this->view->paniers = $paniers; - $this->view->panier_courant = $panier_courant; - $this->view->back_url = $this->_request->getServer('HTTP_REFERER'); + $this->view->panier_courant = $panier; } public function editAction() { - if(!$panier = Class_PanierNotice::find($this->_getParam('id_panier'))) { - $this->_helper->notify($this->_('Le panier n\'existe pas')); - return $this->_redirectToUrlOrReferer('opac/panier'); - } + if(!$panier = Class_PanierNotice::find($this->_getParam('id_panier'))) + return $this->_forward('add'); if (!$this->_user->canModifyPanier($panier)) { $this->_helper->notify($this->_('Vous n\'avez pas le droit de modifier ce panier')); diff --git a/application/modules/opac/views/scripts/panier/add-record-ajax-success.phtml b/application/modules/opac/views/scripts/panier/add-record-ajax-success.phtml index 4cdb403247e6151663bb2be8b8ac748b096a199a..416297d0ea9f427ae17c92ed8e65f3d26bd38c0e 100644 --- a/application/modules/opac/views/scripts/panier/add-record-ajax-success.phtml +++ b/application/modules/opac/views/scripts/panier/add-record-ajax-success.phtml @@ -15,6 +15,7 @@ echo $this->tag('div' , null, true) . '#panier_contenu', $this->_('Accéder au panier %s', - $this->tag('b', $this->panier->getLibelle()))), + $this->tag('b', $this->panier->getLibelle())), + ['class' => 'bouton']), ['class' => 'ajout-result']); ?> \ No newline at end of file diff --git a/application/modules/opac/views/scripts/panier/add-record-ajax.phtml b/application/modules/opac/views/scripts/panier/add-record-ajax.phtml index 1b092daf560b8d84019bd8794922a9c6380334a7..a5174c12336d80d4c1e279c4eea5ffb4e9639db8 100644 --- a/application/modules/opac/views/scripts/panier/add-record-ajax.phtml +++ b/application/modules/opac/views/scripts/panier/add-record-ajax.phtml @@ -1,24 +1,28 @@ <?php +$actions = $this->tag('div', $this->tagAnchor($this->url(['controller' => 'panier', + 'action' => 'add-ajax', + 'id_notice' => $this->notice->getId()]), + $this->_('Nouveau panier'), + ['class' => 'bouton', + 'data-popup' => 'true']) . + + $this->tagAnchor($this->url(['controller' => 'panier', + 'action' => 'switch-ajax', + 'id_panier' => $this->panier->getId(), + 'id_notice' => $this->notice->getId()]), + $this->_('Changer de panier'), + ['class' => 'bouton', + 'data-popup' => 'true']), + ['class' => 'boutons']); + echo $this->tag('div', $this->tag('p', $this->_('Ajouter %s au panier %s ?', $this->tag('b', $this->notice->getTitrePrincipal()), - $this->tag('b', $this->panier->getLibelle()))) . - - $this->tagAnchor($this->url(['controller' => 'panier', - 'action' => 'add-ajax', - 'id_notice' => $this->notice->getId()]), - $this->_('Nouveau panier'), - ['class' => 'bouton', - 'data-popup' => 'true']) . + $this->tag('b', $this->panier->getLibelle())), + ['class' => 'center']) + . $actions); - $this->tagAnchor($this->url(['controller' => 'panier', - 'action' => 'switch-ajax', - 'id_panier' => $this->panier->getId(), - 'id_notice' => $this->notice->getId()]), - $this->_('Changer de panier'), - ['class' => 'bouton', - 'data-popup' => 'true'])); echo $this->renderForm(ZendAfi_Form::newWith([])->setAction($this->url(['controller'=>'panier', 'action'=>'add-record-ajax', diff --git a/application/modules/opac/views/scripts/panier/domain.phtml b/application/modules/opac/views/scripts/panier/domain.phtml new file mode 100644 index 0000000000000000000000000000000000000000..30c7b708e58b397c783b7864cf7e848083d9d988 --- /dev/null +++ b/application/modules/opac/views/scripts/panier/domain.phtml @@ -0,0 +1,34 @@ +<?php +$this->openBoite($this->_('Les paniers rangés dans des domaines')); + +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']); + +$mes_paniers = $this->tagAnchor($this->url(['controller' => 'panier', + 'action' => 'index'], null ,true), + $this->_('Voir mes paniers'), + ['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', $mes_paniers . $panier_pro); + +echo $this->panier_Table($this->paniers, $this->panier_courant, [$this->_('Propriétaire')], ['UserNomComplet']); + +if($this->panier_courant) { + echo $this->tag('a', '', ['name' => 'panier_contenu']) . + $this->listeNotices_TableauPanier($this->panier_courant); +} + +echo $this->abonne_RetourFiche(); + +$this->closeBoite(); +?> diff --git a/application/modules/opac/views/scripts/panier/index.phtml b/application/modules/opac/views/scripts/panier/index.phtml index f7615e367175082e81a97825927a60244fbfca45..93234ebe2922dcc02ae99cf1c612bf8cb1769f2e 100644 --- a/application/modules/opac/views/scripts/panier/index.phtml +++ b/application/modules/opac/views/scripts/panier/index.phtml @@ -6,129 +6,39 @@ echo $this->tag('span', "Vous n'avez aucun panier.", "Vous avez %d panier", "Vous avez %d paniers", - count($this->paniers)) - . BR - . $this->tagAnchor($this->url(['controller' => 'panier', - 'action' => 'add'], null ,true), - $this->_('Créer un nouveau panier'), - ['data-popup' => 'true']), + count($this->paniers)), ['class' => 'abonne', 'id' => 'abonne_erreur']); -$headers = [$this->_('Nom'), - $this->_('Date'), - $this->_('Nombre de notices'), - $this->_('Exporter')]; +$paniers_pro = Class_Users::getIdentity()->hasRightAccessDomaines() + ? $this->tagAnchor($this->url(['controller' => 'panier', + 'action' => 'domain'], null ,true), + $this->_('Voir les paniers rangés dans les domaines'), + ['class' => 'bouton']) . + $this->tagAnchor($this->url(['controller' => 'panier', + 'action' => 'pro'], null ,true), + $this->_('Voir les paniers des professionnels'), + ['class' => 'bouton']) + : ''; -$keys = ['label', - 'date', - 'number_of_notices', - 'exporter']; +$add_panier = $this->tagAnchor($this->url(['controller' => 'panier', + 'action' => 'add'], null ,true), + $this->_('Créer un nouveau panier'), + ['data-popup' => 'true', + 'class' => 'bouton']); -$edit_records = function($model) { - return $this->tagAnchor($this->url(['action' => 'index', - 'id_panier' => $model->getId()]) . '#panier_contenu', - Class_Admin_Skin::current()->renderActionIconOn('edit', $this, []), - ['title' => $this->_('Modifier le contenu du panier %s', $model->getLibelle())]); -}; -$show_records = function($model) { - return $this->tagPreview($this->url(['controller' => 'recherche', - 'action' => 'simple', - 'id_panier' => $model->getId(), - 'retour_panier' => $model->getId()]), - $this->_('Prévisualisation du panier %s dans le résultat de recherche', $model->getLibelle())); -}; -$permalink = function($model) { - return $this->permalink($this->absoluteUrl(['module' => 'opac', - 'controller' => 'recherche', - 'action' => 'simple', - 'id_panier' => $model->getId()], - null, - true)); -}; +echo $this->tag('div', $add_panier . $paniers_pro); -$edit = function($model) { - return $this->tagAnchor($this->url(['action' => 'edit', - 'id_panier' => $model->getId()]), - Class_Admin_Skin::current()->renderActionIconOn('box_configuration', $this, []), - ['title' => $this->_('Modifier les informations du panier %s', $model->getLibelle()), - 'data-popup' => 'true']); -}; - -$delete = function($model) { - return $this->tagAnchor($this->url(['action' => 'delete', - 'id_panier' => $model->getId()]), - Class_Admin_Skin::current()->renderActionIconOn('delete', $this, []), - ['title' => $this->_('Supprimer le panier %s', $model->getLibelle()), - 'onclick' => 'javascript:return confirm(\'' . $this->_('Êtes vous sûr de vouloir supprimer le panier %s?', $model->getLibelle()) . '\')']); -}; - -$actions = [ - $show_records, - $permalink, - $edit_records, - $edit, - $delete -]; - -$custom_keys = [ - 'label' => function($model) { - $links = ''; - if ($model->hasCatalogues()) { - $catalogue_links = []; - $catalogues = $model->getCatalogues(); - foreach($catalogues as $catalogue) - $catalogue_links[] = $this->tagAnchor(['module' => 'admin', - 'controller' => 'catalogue', - 'action' => 'paniers', - 'id_catalogue' => $catalogue->getId()], - $catalogue->getLibelle()); - - $links = $this->tag('div', implode(', ', $catalogue_links)); - } - - return ($this->panier_courant && ($model->getId() == $this->panier_courant->getId()) - ? $this->tag('b', $model->getLibelle()) - : $model->getLibelle()) - . $links; - }, - 'date' => function($model) { - return $this->humanDate($model->getDateMaj(), 'dd/MM/Y'); - }, - 'exporter' => function($model) { - return $this->tagAnchor(['action' => 'export-unimarc', - 'id_panier' => $model->getId()], - $this->_('UNIMARC'), - ['title' => $this->_('Télécharger le parnier %s au format UNIMARC', $model->getLibelle())]) . - ' - ' . - $this->tagAnchor(['action' => 'export-liste', - 'id_panier' => $model->getId()], - $this->_('Liste'), - ['title' => $this->_('Télécharge le parnier %s au format liste', $model->getLibelle())]); - } -]; - -echo $this->tagModelTable($this->paniers, - $headers, - $keys, - $actions, - 'paniers', - null, - $custom_keys); +echo $this->panier_Table($this->paniers, $this->panier_courant); if($this->panier_courant) { - echo $this->listeNotices_TableauPanier($this->panier_courant); + echo $this->tag('a', '', ['name' => 'panier_contenu']) . + $this->listeNotices_TableauPanier($this->panier_courant); } if($this->erreur) echo $this->tag('script', sprintf('alert("%s")', $this->erreur)); echo $this->abonne_RetourFiche(); - -if ($this->back_url) - echo $this->tagAnchor($this->back_url, - $this->_('Retour'), - ['title' => $this->_('Retourner à la page précédente')]); - $this->closeBoite(); ?> diff --git a/application/modules/opac/views/scripts/panier/pro.phtml b/application/modules/opac/views/scripts/panier/pro.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9061b12bd130319e7d29509ddae1ec4e3c4e621d --- /dev/null +++ b/application/modules/opac/views/scripts/panier/pro.phtml @@ -0,0 +1,30 @@ +<?php +$this->openBoite($this->_('Les paniers des professionnels')); + +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']); + +$mes_paniers = $this->tagAnchor($this->url(['controller' => 'panier', + 'action' => 'index'], null ,true), + $this->_('Voir mes paniers'), + ['class' => 'bouton']); + +$panier_domain = $this->tagAnchor($this->url(['controller' => 'panier', + 'action' => 'domain'], null ,true), + $this->_('Voir les paniers rangés dans des domaines'), + ['class' => 'bouton']); + +echo $this->tag('div', $mes_paniers . $panier_domain); + +echo $this->panier_Table($this->paniers, null, [$this->_('Propriétaire')], ['UserNomComplet'], 2); + +echo $this->abonne_RetourFiche(); + +$this->closeBoite(); +?> diff --git a/library/Class/Users.php b/library/Class/Users.php index 51d2a97d86f84479919a04a7a024988f95d11369..09c7d3342e9598e4c026b0341ab7c53f9afc714a 100644 --- a/library/Class/Users.php +++ b/library/Class/Users.php @@ -1187,6 +1187,11 @@ class Class_Users extends Storm_Model_Abstract { } + public function isPanierPro($panier) { + return $panier->getIdUser() != $this->getId(); + } + + /** * @return Class_WebService_SIGB_Emprunteur */ diff --git a/library/ZendAfi/View/Helper/Accueil/Panier.php b/library/ZendAfi/View/Helper/Accueil/Panier.php index 0c3ce5499a6e4c38e02f87e81ed95a91e0248c94..d155d184456440e644f6923993be7126387f5dde 100644 --- a/library/ZendAfi/View/Helper/Accueil/Panier.php +++ b/library/ZendAfi/View/Helper/Accueil/Panier.php @@ -37,24 +37,11 @@ class ZendAfi_View_Helper_Accueil_Panier extends ZendAfi_View_Helper_Accueil_Abo 'action' => 'index'],null,true), $this->preferences['titre']); - return $this->_tag('div', $this->_getHeader() . + return $this->_tag('div', $this->_getActions() . $this->view->listeNotices_TableauPanier($this->_selection)); } - protected function _getHeader() { - $html = $this->_tag('a', '', ['name' => 'panier_contenu']); - $html .= $this->_tag('h2', $this->_selection->getLibelle() - . $this->_tag('b', $this->view->_plural($this->_selection->getNumberOfNotices(), - ' - (Aucun document)', - ' - (%d document)', - ' - (%d documents)', - $this->_selection->getNumberOfNotices()))); - $html .= $this->_getActions(); - return $html; - } - - protected function _getActions() { $html = $this->view->tagPreview($this->view->url(['controller' => 'recherche', 'action' => 'simple', diff --git a/library/ZendAfi/View/Helper/ListeNotices/TableauPanier.php b/library/ZendAfi/View/Helper/ListeNotices/TableauPanier.php index f17e37058a88e84f2765525a7b5c95acc5103c36..7e9e9af5d4b38295560c3a6c8138d4a8bb8a4696 100644 --- a/library/ZendAfi/View/Helper/ListeNotices/TableauPanier.php +++ b/library/ZendAfi/View/Helper/ListeNotices/TableauPanier.php @@ -42,7 +42,7 @@ class ZendAfi_View_Helper_ListeNotices_TableauPanier extends ZendAfi_View_Helper $this->_selection->getLibelle())]); }]; - return $this->view->tagModelTable($this->_selection->getNoticesAsArray(), + return $this->_header() . $this->view->tagModelTable($this->_selection->getNoticesAsArray(), [$this->_('Type de document'), $this->_('Titre principal'), $this->_('Auteur principal')], @@ -56,5 +56,15 @@ class ZendAfi_View_Helper_ListeNotices_TableauPanier extends ZendAfi_View_Helper return $this->view->iconeSupport($model->getTypeDoc()) . ' : ' . $model->getTypeDocLabel(); }]); } + + + protected function _header() { + return $this->_tag('h2', $this->_selection->getLibelle() + . $this->_tag('b', $this->view->_plural($this->_selection->getNumberOfNotices(), + ' - (Aucun document)', + ' - (%d document)', + ' - (%d documents)', + $this->_selection->getNumberOfNotices()))); + } } ?> \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/Panier/Table.php b/library/ZendAfi/View/Helper/Panier/Table.php new file mode 100644 index 0000000000000000000000000000000000000000..61b618b6643be27e931c49df7200ade8948cf28d --- /dev/null +++ b/library/ZendAfi/View/Helper/Panier/Table.php @@ -0,0 +1,128 @@ +<?php +/** + * Copyright (c) 2012-2014, 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_Table extends ZendAfi_View_Helper_BaseHelper { + + public function panier_Table($paniers, $panier_courant, $custom_headers = [], $custom_keys = [], $custom_actions = 5) { + $headers = array_merge([$this->_('Nom'), + $this->_('Date'), + $this->_('Nombre de documents'), + $this->_('Exporter')], + $custom_headers); + + $keys = array_merge(['label', + 'date', + 'number_of_notices', + 'exporter'], + $custom_keys); + + $edit_records = function($model) { + return $this->view->tagAnchor($this->view->url(['action' => 'index', + 'id_panier' => $model->getId()]) . '#panier_contenu', + Class_Admin_Skin::current()->renderActionIconOn('edit', $this->view, []), + ['title' => $this->_('Modifier le contenu du panier %s', $model->getLibelle())]); + }; + $show_records = function($model) { + return $this->view->tagPreview($this->view->url(['controller' => 'recherche', + 'action' => 'simple', + 'id_panier' => $model->getId(), + 'retour_panier' => $model->getId()]), + $this->_('Prévisualisation du panier %s dans le résultat de recherche', $model->getLibelle())); + }; + $permalink = function($model) { + return $this->view->permalink($this->view->absoluteUrl(['module' => 'opac', + 'controller' => 'recherche', + 'action' => 'simple', + 'id_panier' => $model->getId()], + null, + true)); + }; + + $edit = function($model) { + return $this->view->tagAnchor($this->view->url(['action' => 'edit', + 'id_panier' => $model->getId()]), + Class_Admin_Skin::current()->renderActionIconOn('box_configuration', $this->view, []), + ['title' => $this->_('Modifier les informations du panier %s', $model->getLibelle()), + 'data-popup' => 'true']); + }; + + $delete = function($model) { + return $this->view->tagAnchor($this->view->url(['action' => 'delete', + 'id_panier' => $model->getId()]), + Class_Admin_Skin::current()->renderActionIconOn('delete', $this->view, []), + ['title' => $this->_('Supprimer le panier %s', $model->getLibelle()), + 'onclick' => 'javascript:return confirm(\'' . $this->_('Êtes vous sûr de vouloir supprimer le panier %s?', $model->getLibelle()) . '\')']); + }; + + $actions = array_slice([$show_records, + $permalink, + $edit_records, + $edit, + $delete], 0, $custom_actions); + + $custom_keys = [ + 'label' => function($model) use($panier_courant) { + $links = ''; + if ($model->hasCatalogues()) { + $catalogue_links = []; + $catalogues = $model->getCatalogues(); + foreach($catalogues as $catalogue) + $catalogue_links[] = $this->view->tagAnchor(['module' => 'admin', + 'controller' => 'catalogue', + 'action' => 'paniers', + 'id_catalogue' => $catalogue->getId()], + $catalogue->getLibelle()); + + $links = $this->view->tag('div', implode(', ', $catalogue_links)); + } + + return ($panier_courant && ($model->getId() == $panier_courant->getId()) + ? $this->view->tag('b', $model->getLibelle(), ['class' => 'selected']) + : $model->getLibelle()) + . $links; + }, + 'date' => function($model) { + return $this->view->humanDate($model->getDateMaj(), 'dd/MM/Y'); + }, + 'exporter' => function($model) { + return $this->view->tagAnchor(['action' => 'export-unimarc', + 'id_panier' => $model->getId()], + $this->_('UNIMARC'), + ['title' => $this->_('Télécharger le parnier %s au format UNIMARC', $model->getLibelle())]) . + ' - ' . + $this->view->tagAnchor(['action' => 'export-liste', + 'id_panier' => $model->getId()], + $this->_('Liste'), + ['title' => $this->_('Télécharge le parnier %s au format liste', $model->getLibelle())]); + } + ]; + + return $this->view->tagModelTable($paniers, + $headers, + $keys, + $actions, + 'paniers', + null, + $custom_keys); + } +} +?> \ No newline at end of file diff --git a/public/admin/css/subModal.css b/public/admin/css/subModal.css index 78c612f2ac11688149a7297f5e2f842a2dbfedd5..2d8e6c7b87b8fcc15cfc20a653b9273334195a71 100644 --- a/public/admin/css/subModal.css +++ b/public/admin/css/subModal.css @@ -61,10 +61,10 @@ a[data-popup="true"].image-loading-status { background:url(../images/patience.gif) no-repeat center; - width: 16px; - height: 16px; + min-width: 16px; + min-height: 16px; overflow: hidden; - font-size: 0; + color: transparent; } diff --git a/public/opac/css/global.css b/public/opac/css/global.css index 6f57ed86aef5791dd4a21d42675b0b410157b7b3..2931ae28ef0bba7c4dee7127497b839c2a299af1 100644 --- a/public/opac/css/global.css +++ b/public/opac/css/global.css @@ -759,7 +759,16 @@ input[type='password'], input[type='text'], input[type='url'] {border:1px solid #C8C8C8;} -input.bouton{ font-size: 0.9em; color:#5f5f5f; background-color:#f0f0f0; border:1px solid #afafaf; cursor:pointer; padding:1px;} +a.bouton, +input.bouton { + font-size: 0.9em; + color: #5f5f5f; + background-color: #f0f0f0; + border: 1px solid #afafaf; + cursor: pointer; + padding: 1px; + margin: 1px; +} img {border:none;} @@ -2087,10 +2096,11 @@ div.suggestion-achat-liste dl{ display: inline; } -.panier_index span#abonne_erreur { +span#abonne_erreur { display:block; } -.panier_index span#abonne_erreur + a { + +span#abonne_erreur + a { display: inline-block; } @@ -3316,4 +3326,23 @@ dd.picture { .filters.list.right + .leaflet_osm { width: 69%; +} + +#opac-dialog .boutons { + margin-top: 2em; + text-align: center; +} + + +#opac-dialog .boutons > div { + display: inline-block; + text-align: center; +} + +#opac-dialog .boutons > div a { + display: inline-block; +} + +.center { + text-align: center; } \ No newline at end of file diff --git a/tests/application/modules/opac/controllers/PanierControllerTest.php b/tests/application/modules/opac/controllers/PanierControllerTest.php index 85e32937bfa89b0564a86873f791a541f8aacfbe..8192323b277664a519228f1fdd8b4252df615855 100644 --- a/tests/application/modules/opac/controllers/PanierControllerTest.php +++ b/tests/application/modules/opac/controllers/PanierControllerTest.php @@ -1712,7 +1712,7 @@ class PanierControllerSavePanierTest extends AbstractControllerTestCase { /** @test */ public function responseShouldContainsAjaxSucessJson() { - $this->assertContains('<div class=\"ajout-result\"><p>Le document <b>Pomme<\/b> a \u00e9t\u00e9 ajout\u00e9 au panier <b><\/b><\/p><a href=\"\/panier\/index\/id_panier\/1#panier_contenu\">Acc\u00e9der au panier <b><\/b><\/a><\/div>', $this->_response->getBody()); + $this->assertContains('<div class=\"ajout-result\"><p>Le document <b>Pomme<\/b> a \u00e9t\u00e9 ajout\u00e9 au panier <b><\/b><\/p><a href=\"\/panier\/index\/id_panier\/1#panier_contenu\" class=\"bouton\">Acc\u00e9der au panier <b><\/b><\/a><\/div>', $this->_response->getBody()); } } @@ -1745,7 +1745,7 @@ class PanierControllerAddActionTest extends AbstractControllerTestCase { -class PanierControllerSwitchAction extends PanierControllerSimpleLoggedUserTestCase { +class PanierControllerSwitchActionTest extends PanierControllerSimpleLoggedUserTestCase { public function setUp() { parent::setUp(); $this->dispatch('/panier/switch', true); @@ -1760,7 +1760,7 @@ class PanierControllerSwitchAction extends PanierControllerSimpleLoggedUserTestC -class PanierControllerSwitchPostAction extends PanierControllerSimpleLoggedUserTestCase { +class PanierControllerSwitchPostActionTest extends PanierControllerSimpleLoggedUserTestCase { public function setUp() { parent::setUp(); $this->postDispatch('/panier/switch', ['id_panier' => 15], true); @@ -1775,7 +1775,7 @@ class PanierControllerSwitchPostAction extends PanierControllerSimpleLoggedUserT -class PanierControllerSwitchAjaxPostAction extends PanierControllerSimpleLoggedUserTestCase { +class PanierControllerSwitchAjaxPostActionTest extends PanierControllerSimpleLoggedUserTestCase { public function setUp() { parent::setUp(); $this->postDispatch('/panier/switch-ajax', ['id_panier' => 15], true); @@ -1786,4 +1786,34 @@ class PanierControllerSwitchAjaxPostAction extends PanierControllerSimpleLoggedU public function shouldRedirect() { $this->assertRedirectTo('http://localhost' . BASE_URL . '/panier/add-record-ajax'); } +} + + + +class PanierControllerDomainActionTest extends PanierControllerTestCase { + public function setUp() { + parent::setUp(); + $this->dispatch('/panier/domain', true); + } + + + /** @test */ + public function tableShouldContainsSelectionJeunesse() { + $this->assertXPathContentContains('//div//table', 'selection jeunesse'); + } +} + + + +class PanierControllerProActionTest extends AbstractControllerTestCase { + public function setUp() { + parent::setUp(); + $this->dispatch('/panier/pro', true); + } + + + /** @test */ + public function tableShouldBeDisplayed() { + $this->assertXPathContentContains('//div//h1', 'Les paniers des professionnels'); + } } \ No newline at end of file