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

dev #17514 indexation refactoring

Add more info into record from inspector_gadget
parent 8b26d76d
Branches
Tags
4 merge requests!715Master,!686Dev#17514 indexation refactoring,!649Dev#19675 improve display articles and sito in kiosque,!630Dev#17514 indexation refactoring
......@@ -32,7 +32,25 @@ class ZendAfi_View_Helper_Notice_Unimarc extends Zend_View_Helper_HtmlElement {
$reader->setNotice($notice->getUnimarc(), 0);
$reader->acceptVisitor($this);
return $this->renderHeader($notice) . '<hr>' . $this->renderZones();
return
$this->renderHeader($notice)
. '<hr>'
. $this->renderNotice($notice)
. '<hr>'
. $this->renderZones();
}
protected function renderNotice($notice) {
$fields = ['facettes' => $this->_('Facettes'),
'date_creation' => $this->_('Création / nouveauté'),
'date_maj' => $this->_('Mis à jour le'),
'clef_alpha' => $this->_('Clé alpha'),
'clef_oeuvre' => $this->_('Clé oeuvre')];
$html = '';
foreach ($fields as $field => $label)
$html .= $label . ': ' . $notice->callGetterByAttributeName($field) . '<br>';
return $html;
}
......
<?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_Notice_UnimarcTest extends ViewHelperTestCase {
public function setUp() {
parent::setUp();
$this->_helper = new ZendAfi_View_Helper_Notice_Unimarc();
$this->_helper->setView(new ZendAfi_Controller_Action_Helper_View());
$this->_html = $this->_helper->notice_Unimarc($this->fixture('Class_Notice',
['id' => 1,
'titre' => 'Pomme et Ananas',
'clef_alpha' => 'POMMEETANANAS',
'facettes' => 'A1 Q9',
'date_maj' => '01/01/2015',
'unimarc' => '']));
}
/** @test */
public function alphaKeyShouldBePresent() {
$this->assertContains('Clé alpha: POMMEETANANAS', $this->_html);
}
/** @test */
public function dateMajShouldBePresent() {
$this->assertContains('Mis à jour le: 01/01/2015', $this->_html);
}
/** @test */
public function facetsShouldBePresent() {
$this->assertContains('Facettes: A1 Q9', $this->_html);
}
}
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