Skip to content
Snippets Groups Projects
Commit 82c4ad63 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#13981-php-error-when-searching' into 'hotline_6.44'

Hotline#13981 Php Error When Searching
parents 6a36e4f7 e4513727
Branches
Tags
4 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!180Master,!137Master,!136Hotline 6.44
......@@ -18,14 +18,11 @@
* 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
*/
//////////////////////////////////////////////////////////////////////////////////////////
// OPAC3 : Codifications
//////////////////////////////////////////////////////////////////////////////////////////
class Class_Codification {
use Trait_Singleton, Trait_Translator;
const
CHAMPS = "JAKEFCNMDGHPILOR8",
CHAMPS = 'JAKEFCNMDGHPILOR8',
CODE_COLLECTION = 'C',
CODE_EDITEUR = 'E',
CODE_IDENTIFIANT = 'I',
......@@ -41,17 +38,12 @@ class Class_Codification {
//------------------------------------------------------------------------------------------------------
// Liste des types de documents
//------------------------------------------------------------------------------------------------------
function getTypesDocs() {
public function getTypesDocs() {
return Class_TypeDoc::allByIdLabel();
}
//------------------------------------------------------------------------------------------------------
// Combo types de docs
//------------------------------------------------------------------------------------------------------
function getComboTypesDocs($valeur,$events="",$tous=false)
public function getComboTypesDocs($valeur, $events='', $tous=false)
{
/*
* Attention: utilisé dans la sélection type doc recherche simple et certains suppriment des types de
......@@ -76,7 +68,8 @@ class Class_Codification {
return $combo;
}
function getCodesLibellesFacette($concatenated_facettes) {
public function getCodesLibellesFacette($concatenated_facettes) {
$codes_libelles=[];
for($i=0; $i<strlen($concatenated_facettes); $i++) {
......@@ -93,10 +86,7 @@ class Class_Codification {
}
//------------------------------------------------------------------------------------------------------
// Retourne libelle correspondant à un code facette
//------------------------------------------------------------------------------------------------------
function getLibelleFacette($rubrique) {
public function getLibelleFacette($rubrique) {
$type=$rubrique[0];
if (!$id=substr($rubrique,1))
return '';
......@@ -126,7 +116,7 @@ class Class_Codification {
}
function genereNomsChamps () {
public function genereNomsChamps () {
if (isset($this->_nom_champs))
return;
......@@ -160,7 +150,7 @@ class Class_Codification {
$l=getVar("FACETTE_TYPE_DOC_LIBELLE") ; if(trim($l)) {$this->_nom_champs[Class_TypeDoc::CODE_FACETTE][0]=$l; $this->_nom_champs[Class_TypeDoc::CODE_FACETTE][1]=$l; }
$l=getVar("FACETTE_LANGUE_LIBELLE") ; if(trim($l)) {$this->_nom_champs[Class_CodifLangue::CODE_FACETTE][0]=$l; $this->_nom_champs[Class_CodifLangue::CODE_FACETTE][1]=$l; }
$l=getVar("FACETTE_GENRE_LIBELLE") ; if(trim($l)) {$this->_nom_champs[Class_CodifGenre::CODE_FACETTE][0]=$l; $this->_nom_champs[Class_CodifGenre::CODE_FACETTE][1]=$l; }
$l=getVar("FACETTE_SITE_LIBELLE") ; if(trim($l)) {$this->_nom_champs[Class_CodifIntBib::CODE_FACETTE][0]=$l; $this->_nom_champs[Class_CodifIntBib::CODE_FACETTE][1]=$l; }
$l=getVar("FACETTE_SITE_LIBELLE") ; if(trim($l)) {$this->_nom_champs[Class_IntBib::CODE_FACETTE][0]=$l; $this->_nom_champs[Class_IntBib::CODE_FACETTE][1]=$l; }
$l=getVar("FACETTE_SECTION_LIBELLE") ; if(trim($l)) {$this->_nom_champs[Class_CodifSection::CODE_FACETTE][0]=$l; $this->_nom_champs[Class_CodifSection::CODE_FACETTE][1]=$l; }
$l=getVar("FACETTE_BIBLIOTHEQUE_LIBELLE") ; if(trim($l)) {$this->_nom_champs[Class_CodifAnnexe::CODE_FACETTE][0]=$l; $this->_nom_champs[Class_CodifAnnexe::CODE_FACETTE][1]=$l; }
$l=getVar("FACETTE_AUTEUR_LIBELLE") ; if(trim($l)) {$this->_nom_champs[Class_Auteur::CODE_FACETTE][0]=$l; $this->_nom_champs[Class_Auteur::CODE_FACETTE][1]=$l; }
......@@ -177,9 +167,8 @@ class Class_Codification {
}
}
//------------------------------------------------------------------------------------------------------
// Retourne un nom de champ a partir d'1 type ou d'1 facette
//------------------------------------------------------------------------------------------------------
function getNomChamp($code,$pluriel=0) {
if ($code[0]==Class_CodifThesaurus::CODE_FACETTE)
$type=$code;
......@@ -200,13 +189,9 @@ class Class_Codification {
function getNomFacette($code) {
// return self::getNomChamp(str_replace('T', 't', $code));
return self::getNomChamp( $code);
return self::getNomChamp($code);
}
//------------------------------------------------------------------------------------------------------
// Retourne un nom d'onglet pour les notices
//------------------------------------------------------------------------------------------------------
function genereNomsOnglets () {
if (isset($this->_nom_onglets))
......@@ -241,6 +226,7 @@ class Class_Codification {
}
function getAllOnglets() {
self::genereNomsOnglets();
return $this->_nom_onglets;
......@@ -252,34 +238,27 @@ class Class_Codification {
return $onglet ? $this->_nom_onglets[$onglet]->getLibelle() : $this->_nom_onglets;
}
public static function getLibelleForSerie($notice) {
$message='';
switch ($notice->getTypeDoc()) {
$message = 'Voir tous les tomes';
switch ($notice->getTypeDoc()) {
case Class_TypeDoc::PERIODIQUE:
$message = 'Voir tous les numéros';
break;
case Class_TypeDoc::DVD:
$message = 'Voir tous les épisodes';
break;
default:
$message = 'Voir tous les tomes';
break;
}
return self::concatLibelleWithTitreChapeau($message,$notice->getTitreChapeau());
}
return self::concatLibelleWithTitreChapeau($message, $notice->getTitreChapeau());
}
public static function concatLibelleWithTitreChapeau($libelle,$chapeau) {
$first_letter = substr($chapeau,0,1);
if (in_array ($first_letter,['H','E','A','I','O','U']))
return $libelle.' d\''.$chapeau;
return $libelle.' de '.$chapeau;
public static function concatLibelleWithTitreChapeau($libelle,$chapeau) {
$first_letter = substr($chapeau, 0, 1);
if (in_array($first_letter, ['H','E','A','I','O','U']))
return $libelle . ' d\'' . $chapeau;
return $libelle . ' de ' . $chapeau;
}
}
\ No newline at end of file
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