diff --git a/VERSIONS_HOTLINE/11784 b/VERSIONS_HOTLINE/11784 new file mode 100644 index 0000000000000000000000000000000000000000..ee16d194db64d13dd144359477de2d768efc2650 --- /dev/null +++ b/VERSIONS_HOTLINE/11784 @@ -0,0 +1 @@ +- ticket #11784 : le type de document peut être ajouté en en-tête de notice \ No newline at end of file diff --git a/library/Class/CodifTypeDoc.php b/library/Class/CodifTypeDoc.php index c22adbb4c5e409d98e193c3e0b08db3f7d59adda..94dfaf5a197da300f5f5752d76f82af1a418b8ab 100644 --- a/library/Class/CodifTypeDoc.php +++ b/library/Class/CodifTypeDoc.php @@ -34,7 +34,7 @@ class Class_CodifTypeDoc extends Storm_Model_Abstract { const SONORE = 3; const VIDEO = 4; const LOGICIEL = 5; - + const CODE_FACETTE = 'T'; protected static $_libelles = [ self::INCONNU => 'Non identifié', self::LIVRE => 'Livre', diff --git a/library/Class/Notice.php b/library/Class/Notice.php index dca162eb197c85898117a7805a334bd229332a66..2dc8bdc49513831dc7ec1bab3f82d50da1687286 100644 --- a/library/Class/Notice.php +++ b/library/Class/Notice.php @@ -652,6 +652,7 @@ class Class_Notice extends Storm_Model_Abstract { Class_CodifDewey::CODE_FACETTE, Class_CodifPcdm4::CODE_FACETTE, Class_CodifMatiere::CODE_FACETTE, + Class_TypeDoc::CODE_FACETTE, Class_CodifGenre::CODE_FACETTE, Class_CodifCentreInteret::CODE_FACETTE])) { $ret = []; @@ -1690,7 +1691,13 @@ class Class_Notice extends Storm_Model_Abstract { public function updateFacetsFromExemplaires() { $facettes = []; - $filtered = ['B', 'E', 'S', 'Y', 'T', '2', 'V']; + $filtered = [Class_IntBib::CODE_FACETTE, + Class_CodifEmplacement::CODE_FACETTE, + Class_CodifSection::CODE_FACETTE, + Class_CodifAnnexe::CODE_FACETTE, + Class_CodifTypeDoc::CODE_FACETTE, + '2', + Class_Codification::CODE_AVAILABILITY]; foreach (array_filter(explode(' ', $this->getFacettes())) as $f) { $type = substr($f, 0, 1); if (in_array($type, $filtered)) @@ -1698,28 +1705,28 @@ class Class_Notice extends Storm_Model_Abstract { $facettes []= $f; } - // facette type de document - $facettes []= 'T' . $this->getTypeDoc(); + + $facettes []= Class_CodifTypeDoc::CODE_FACETTE. $this->getTypeDoc(); $date_nouveaute = ""; $exemplaires = $this->getExemplaires(); foreach($exemplaires as $exemplaire) { - $facettes []= 'B'.$exemplaire->getIdBib(); + $facettes []= Class_IntBib::CODE_FACETTE.$exemplaire->getIdBib(); if ($genre = trim((string)$exemplaire->getGenre())) - $facettes []= 'G'.$genre; + $facettes []= Class_CodifGenre::CODE_FACETTE.$genre; if ($section = trim((string)$exemplaire->getSection())) - $facettes []= 'S'.$section; + $facettes []= Class_CodifSection::CODE_FACETTE.$section; if ($emplacement = trim((string)$exemplaire->getEmplacement())) - $facettes []= 'E'.$emplacement; + $facettes []= Class_CodifEmplacement::CODE_FACETTE.$emplacement; if ($annexe = trim((string)$exemplaire->getAnnexe())) - $facettes []= 'Y'.$annexe; + $facettes []= Class_CodifAnnexe::CODE_FACETTE.$annexe; if ($exemplaire->isDisponible(true)) - $facettes []= 'V'.$exemplaire->getIdBib(); + $facettes []= Class_Codification::CODE_AVAILABILITY.$exemplaire->getIdBib(); $date_exemplaire = $exemplaire->getDateNouveaute(); if ($date_exemplaire > $date_nouveaute) diff --git a/library/ZendAfi/View/Helper/ListeNotices/Tableau.php b/library/ZendAfi/View/Helper/ListeNotices/Tableau.php index c68034583f499e213fe665eae3fbebea1f779e33..06209672beae1665ef7301f79a59dd76c73476b8 100644 --- a/library/ZendAfi/View/Helper/ListeNotices/Tableau.php +++ b/library/ZendAfi/View/Helper/ListeNotices/Tableau.php @@ -64,6 +64,9 @@ class ZendAfi_View_Helper_ListeNotices_Tableau extends ZendAfi_View_Helper_Liste if (is_array($value)) $value = $value[0]; + if (is_array($value) && array_key_exists('libelle',$value)) + $value = $value['libelle']; + if($champ == "N") $align='style="text-align:center"'; else $align=""; $html.='<td class="'. $style_css .'" '.$align.'>'.$value.'</td>'; } diff --git a/tests/library/ZendAfi/View/Helper/Notice/EnteteTest.php b/tests/library/ZendAfi/View/Helper/Notice/EnteteTest.php index 68b8ad642582f42aaa3c082d1fd893d3d222b13b..1d3798e18279cefd1b5bc5ae05c280b42ec7023f 100644 --- a/tests/library/ZendAfi/View/Helper/Notice/EnteteTest.php +++ b/tests/library/ZendAfi/View/Helper/Notice/EnteteTest.php @@ -79,7 +79,7 @@ class ZendAfi_View_Helper_Notice_EnteteTest extends ViewHelperTestCase { $notice = $album->getNotice(); - $this->_html = $this->_helper->Notice_Entete($notice, ['entete' => Class_Codification::CHAMPS]); + $this->_html = $this->_helper->Notice_Entete($notice, ['entete' => Class_Codification::CHAMPS . Class_CodifTypeDoc::CODE_FACETTE]); } @@ -99,4 +99,12 @@ class ZendAfi_View_Helper_Notice_EnteteTest extends ViewHelperTestCase { public function resumeShouldCOntainsForTheEvening() { $this->assertXPathContentContains($this->_html, '//dl//dd', utf8_encode('<p>pour passer la soirée</p>'), $this->_html); } + + + /** @test */ + public function typeDocShouldBeDiaporama() { + $this->assertXPathContentContains($this->_html, + '//dl//dd/a[contains(@href, "/code_rebond/T101")]', + 'Diaporama'); + } } \ No newline at end of file