Skip to content
Snippets Groups Projects
Commit 8078afa2 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch...

Merge branch 'hotline#122399_gpsea_p4_page_notice_exemplaires_modification_informations_de_la_carte' into origin-hotline

# Conflicts:
#	library/templates/Chili/Library/Settings.php
parents 7ea9c932 d3bf2b93
Branches
Tags
1 merge request!3782Hotline
Pipeline #11923 failed with stage
in 1 hour
- ticket #122399 : Magasin de thèmes : Ajout des horaires dans la carte open street map des exemplaires dans le thème Chili.
\ No newline at end of file
......@@ -122,11 +122,7 @@ class ZendAfi_View_Helper_RenderLibrary extends ZendAfi_View_Helper_BaseHelper {
protected function renderOpeningHours() {
$openings = $this->library->getHoraire()
? $this->library->getHoraire()
: $this->view->libraryOpenings($this->library);
return $this->_renderField($this->_escapeInfo($openings),
return $this->_renderField($this->view->renderLibraryOpeningHours($this->library),
'field-opening-hours');
}
......@@ -182,9 +178,4 @@ class ZendAfi_View_Helper_RenderLibrary extends ZendAfi_View_Helper_BaseHelper {
return $this->_tag('div', $content, $attributes);
}
protected function _escapeInfo($info) {
return str_replace('BR', '<br>', urldecode(str_replace('%0D%0A','BR', $info)));
}
}
\ No newline at end of file
<?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 ZendAfi_View_Helper_RenderLibraryOpeningHours extends ZendAfi_View_Helper_BaseHelper {
public function renderLibraryOpeningHours($library) {
$openings = ($horaire = $library->getHoraire())
? $horaire
: $this->view->libraryOpenings($library);
return str_replace('BR', '<br>', urldecode(str_replace('%0D%0A','BR', $openings)));
}
}
......@@ -104,6 +104,8 @@ class Chili_Library_Settings extends Intonation_Library_Settings {
$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';
$hydrating_mapping['div class description_library_openings'] = 'col-12';
$hydrating_mapping['div class description_library_opened'] = 'col-12';
$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_Library_Wrapper_Library extends Intonation_Library_View_Wrapper_Library {
protected function _renderOpening(){
$html = [$this->_view->div(['class'=>'description_library_openings'],
$this->_view->renderLibraryOpeningHours($this->_model)),
$this->_view->div(['class'=>'description_library_opened'],
parent::_renderOpening())
];
return $this->_view->grid($html, ['class' => 'description_library_opening_hours']);
}
}
......@@ -118,6 +118,7 @@ class Chili_Template extends Intonation_Template {
protected function _getMapWrapper() {
return
array_merge(parent::_getMapWrapper(),
['Class_Notice' => 'Chili_Library_Wrapper_Record']);
['Class_Notice' => 'Chili_Library_Wrapper_Record',
'Class_Bib' => 'Chili_Library_Wrapper_Library']);
}
}
\ No newline at end of file
......@@ -27,9 +27,7 @@ class Intonation_Library_View_Wrapper_ItemForOsm extends Intonation_Library_View
if (!$library = $this->_model->getBib())
return $description;
$wrapper = (new Intonation_Library_View_Wrapper_Library)
->setModel($library)
->setView($this->_view);
$wrapper = Class_Template::current()->newWrapper($library, $this->_view);
return
$description
......
......@@ -411,6 +411,7 @@ class Intonation_Template extends Class_Template {
protected function _getMapWrapper() {
return ['Class_Notice' => 'Intonation_Library_View_Wrapper_Record'];
return ['Class_Notice' => 'Intonation_Library_View_Wrapper_Record',
'Class_Bib' => 'Intonation_Library_View_Wrapper_Library'];
}
}
......@@ -26,6 +26,9 @@ class Intonation_View_Grid extends ZendAfi_View_Helper_BaseHelper {
if (!$html)
return '';
if (is_array($html))
$html = implode($html);
if (!isset($container_attribs['class']))
$container_attribs ['class'] = '';
......
<?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 ChiliLibraryOSMInRecordItemsTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->_buildTemplateProfil(['id' => 25,
'template' => 'CHILI']);
$this->fixture('Class_Notice',
['id' => 153,
'exemplaires' => [
$this->fixture('Class_Exemplaire',
['id' => 352,
'id_bib' => 2
]),
$this->fixture('Class_Exemplaire',
['id' => 353,
'id_bib' => 3
])
]
]);
$this->fixture('Class_Bib',
['id' => 2,
'libelle' => "Annecy",
'id_lieu' => 3,
'horaire' => 'Lundi : 9h00'
]);
$this->fixture('Class_Lieu',
['id' => 3,
'libelle' => "Bonlieu",
'latitude' => '45.5',
'longitude' => '5'
]);
$this->fixture('Class_Bib',
['id' => 3,
'libelle' => "Dombes",
'id_lieu' => 4
]);
$this->fixture('Class_Lieu',
['id' => 4,
'libelle' => "Autrelieu",
'latitude' => '49.5',
'longitude' => '7'
]);
$this->fixture('Class_Ouverture',
['id' => 10,
'label' => 'Normal',
'debut_matin' => '09:00',
'jour_semaine' => Class_Ouverture::MARDI,
'id_site' => 3
]);
$this->dispatch('noticeajax/items-resources/id/153/id_profil/25');
}
/** @test */
public function dataOSMShouldContainsAnnecyOuvertLundiA9h00() {
$this->assertXPath('//div[contains(@id,"osm_map")][contains(@data-osm,"Lundi : 9h00")]');
}
/** @test */
public function dataOSMShouldContainsDombesOuvertMardiA15h00() {
$this->assertXPath('//div[contains(@id,"osm_map")][contains(@data-osm,"Mardi : 09h")]');
}
/** @test */
public function dataOSMShouldContainsClassLibraryOpeningsCol12() {
$this->assertXPath('//div[contains(@id,"osm_map")][contains(@data-osm,"description_library_openings col-12")]');
}
/** @test */
public function dataOSMShouldContainsClassLibraryOpenedCol12() {
$this->assertXPath('//div[contains(@id,"osm_map")][contains(@data-osm,"description_library_opened col-12")]');
}
}
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