Skip to content
Snippets Groups Projects
Commit 9b66e761 authored by Arthur Suzuki's avatar Arthur Suzuki
Browse files

Merge branch...

Merge branch 'hotline#122926_gpsea_p1_page_notice_ou_le_trouver__ajout_bouton_reserver' into 'hotline'

hotline MT #122926 : Add hold link in items Ressources of Chili Theme

See merge request !3773
parents e6ed958f 788095cc
Branches
Tags
2 merge requests!3782Hotline,!3773hotline MT #122926 : Add hold link in items Ressources of Chili Theme
Pipeline #11920 passed with stage
in 57 minutes and 1 second
- ticket #122926 : Magasin de Thèmes : Ajout d'un lien réserver au dessus de la carte des exemplaires dans le thème Chili
\ No newline at end of file
......@@ -103,6 +103,7 @@ class Chili_Library_Settings extends Intonation_Library_Settings {
$hydrating_mapping['div class user_informations_fields'] = 'card-body pl-0 pt-2';
$hydrating_mapping['dt class user_info'] = 'col-12';
$hydrating_mapping['dd class user_info'] = 'col-12';
$hydrating_mapping['div class items_hold_link'] = 'col-12 p-3 my-3 text-center';
$settings[$this->_template->withNameSpace('hydrating_mapping')] = $hydrating_mapping;
return $settings;
......
<?php
/**
* Copyright (c) 2012-2020, 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 Chili_View_RenderRecord_RenderItems extends Intonation_View_RenderRecord_RenderItems {
protected function _hookForMoreHtml($items) {
if ( ! $first_item = reset($items))
return '';
if ( ! $record = $first_item->getNotice())
return '';
$hold = new Intonation_Library_Link(['Url' => $this->view->url(['controller' => 'abonne',
'action' => 'reserver',
'record_id' => $record->getId()]),
'Text' => $this->_('Réserver'),
'Image' => (Class_Template::current()
->getIco($this->view,
'hold',
'library')),
'Title' => $this->_('Réserver le document %s',
$record->getTitreEtSousTitre(' ')),
'Popup' => true]);
return $this->view->div(['class' => 'items_hold_link'],
$this->view->tagAction($hold));
}
}
......@@ -32,12 +32,11 @@ class Intonation_View_RenderRecord_RenderItems extends ZendAfi_View_Helper_BaseH
->setView($this->view)
->setModel($element);
});
$html = [];
$html = [ $this->_hookForMoreHtml($items) ];
if ($map = $this->view->osmMap($elements))
$html [] = $this->view->div(['class' => 'col-12 mb-3 items_map'],
$map);
$html [] = $this->view->div(['class' => 'col-12 items_wall'],
$this->_getHtmlItems($items));
......@@ -122,4 +121,9 @@ class Intonation_View_RenderRecord_RenderItems extends ZendAfi_View_Helper_BaseH
return $items;
}
protected function _hookForMoreHtml($items) {
return '';
}
}
<?php
/**
* Copyright (c) 2012-2020, 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 ChiliItemsDispatchTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->_buildTemplateProfil(['id' => 3,
'template' => 'CHILI']);
$this->fixture('Class_Notice',
['id' => 2,
]);
$this->fixture('Class_Exemplaire',
['id' => 1,
'id_notice' => 2
]);
$this->dispatch('noticeajax/items-resources/id/2');
}
/** @test */
public function pageShouldContainsLinkToHold() {
$this->assertXPathContentContains('//div[@class="items_hold_link col-12 p-3 my-3 text-center"]//a[contains(@href, "abonne/reserver")]',
utf8_encode('Réserver'));
}
}
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