Skip to content
Snippets Groups Projects
Commit efc599f0 authored by llaffont's avatar llaffont
Browse files

Correction affichage notice détaillé lorsque des fonctions avec apostrophes sont dans l'unimarc

parent 30475491
Branches
Tags
No related merge requests found
......@@ -1725,6 +1725,8 @@ library/Class/CentreInteret.php -text
library/Class/CmsRank.php -text
library/Class/CmsUrlTransformer.php -text
library/Class/CodifAnnexe.php -text
library/Class/CodifAuteur.php -text
library/Class/CodifAuteurFonction.php -text
library/Class/CodifEmplacement.php -text
library/Class/CodifGenre.php -text
library/Class/CodifLangue.php -text
......
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 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).
*
* AFI-OPAC 2.0 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 AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_CodifAuteur extends Storm_Model_Abstract {
protected $_table_name = 'codif_auteur';
protected $_table_primary = 'id_auteur';
}
?>
\ No newline at end of file
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 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).
*
* AFI-OPAC 2.0 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 AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_CodifAuteurFonction extends Storm_Model_Abstract {
protected $_table_name = 'codif_auteurs_fonctions';
protected $_table_primary = 'id_fonction';
}
?>
\ No newline at end of file
......@@ -68,6 +68,9 @@ class NoticeLoader extends Storm_Model_Loader
}
}
class Class_Notice extends Storm_Model_Abstract {
protected $_loader_class = 'NoticeLoader';
protected $_table_name = 'notices';
......@@ -707,7 +710,6 @@ class Class_Notice extends Storm_Model_Abstract {
* @return array
*/
protected function _getTitresDansZones($zones) {
xdebug_break();
if (!is_array($zones) || empty($zones))
return [];
......@@ -926,19 +928,21 @@ class Class_Notice extends Storm_Model_Abstract {
$code_alpha = str_replace(' ', 'x', $code_alpha);
if (!$code_alpha)
return [];
$id_auteur = fetchOne("Select id_auteur from codif_auteur where MATCH(formes) AGAINST('\"" . $code_alpha . "\"' IN BOOLEAN MODE) ");
if (!$id_auteur)
if (!$codif_auteur = Class_CodifAuteur::findFirstBy(['where' => "MATCH(formes) AGAINST('" . $code_alpha . "' IN BOOLEAN MODE)"]))
return [];
$fonction = fetchOne("select libelle from codif_auteurs_fonctions where id_fonction='$fonction'");
if ($fonction_pergame)
$fonction = $fonction_pergame;
else {
if ($auteur_fonction = Class_CodifAuteurFonction::find($fonction))
$fonction = $auteur_fonction->getLibelle();
}
return [
'id' => $id_auteur,
'id' => $codif_auteur->getId(),
'libelle' => trim($prenom . ' ' . $nom) . (($fonction) ? ' <font color="#666666">(' . $fonction . ')</font>': ''),
'url' => BASE_URL . "/recherche/rebond?facette=reset&amp;code_rebond=A" . $id_auteur
'url' => BASE_URL . "/recherche/rebond?facette=reset&amp;code_rebond=A" . $codif_auteur->getId()
];
}
......
No preview for this file type
......@@ -35,6 +35,8 @@ class NoticeFixtures extends TestFixtures {
}
class NoticeTestFindAll extends ModelTestCase {
public function setUp() {
$this->_setFindAllExpectation('Class_Notice', 'NoticeFixtures');
......@@ -80,6 +82,8 @@ class NoticeTestTypeDoc extends ModelTestCase {
}
class NoticeTestGetAvis extends ModelTestCase {
public function setUp() {
$this->avis_bib1 = new Class_AvisNotice();
......@@ -118,17 +122,20 @@ class NoticeTestGetAvis extends ModelTestCase {
$this->notice->getAvisBibliothequaires());
}
public function testGetNoteMoyenneAvisBibliothequaires() {
$this->assertEquals(4.5,
$this->notice->getNoteMoyenneAvisBibliothequaires());
}
public function testGetAvisAbonnes() {
$this->assertEquals(array($this->avis_abon1,
$this->avis_abon2),
$this->notice->getAvisAbonnes());
}
public function testGetNoteMoyenneAvisAbonnes() {
$this->assertEquals(2.5,
$this->notice->getNoteMoyenneAvisAbonnes());
......
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