diff --git a/VERSIONS_WIP/81468 b/VERSIONS_WIP/81468 new file mode 100644 index 0000000000000000000000000000000000000000..399961fff40423359f672383c77cd1627e2a3770 --- /dev/null +++ b/VERSIONS_WIP/81468 @@ -0,0 +1 @@ + - ticket #81468 : Inspecteur Gadget : Ajout de la zone de label dans l'inspecteur de notices \ No newline at end of file diff --git a/library/Class/NoticeUnimarc/Writer.php b/library/Class/NoticeUnimarc/Writer.php index f8e8b2581ab79fbc60d07174ad9af9aa0c4b647f..895e29a2662fdb70a941d55dfa2b97c3696e7989 100644 --- a/library/Class/NoticeUnimarc/Writer.php +++ b/library/Class/NoticeUnimarc/Writer.php @@ -835,6 +835,7 @@ class Class_NoticeUnimarc_Writer extends Class_NoticeUnimarc { ->visitHierarchyLevel($this->inner_guide['hl']) ->visitDataAdress($this->inner_guide['ba']) ->visitCatalogLevel($this->inner_guide['el']) + ->visitGuide($this->guide) ; foreach ($this->inner_data as $label => $contents) { diff --git a/library/ZendAfi/View/Helper/Notice/Unimarc.php b/library/ZendAfi/View/Helper/Notice/Unimarc.php index 41330ec655e97ed4ab69465d6c29e6f6d89f024c..00923a4b2ca21cd6a80d759d4f5ad9e69d6ab9a0 100644 --- a/library/ZendAfi/View/Helper/Notice/Unimarc.php +++ b/library/ZendAfi/View/Helper/Notice/Unimarc.php @@ -23,8 +23,10 @@ class ZendAfi_View_Helper_Notice_Unimarc extends Zend_View_Helper_HtmlElement { use Trait_Translator, Trait_Yaz; - protected $_headers; - protected $_zones; + protected + $_headers, + $_zones, + $_guide; public function notice_Unimarc($notice) { $this->_headers = $this->_zones = []; @@ -98,7 +100,7 @@ class ZendAfi_View_Helper_Notice_Unimarc extends Zend_View_Helper_HtmlElement { protected function renderZones($notice) { - $html = ''; + $html = $this->_renderGuide(); foreach ($this->_zones as $zone) $html .= $zone->render(); @@ -108,6 +110,17 @@ class ZendAfi_View_Helper_Notice_Unimarc extends Zend_View_Helper_HtmlElement { } + protected function _renderGuide() { + return $this->_guide + ? $this->_tag('tr', + $this->_tag('td', $this->_('label')) + . $this->_tag('td', '') + . $this->_tag('td', '') + . $this->_tag('td', $this->_guide)) + : ''; + } + + protected function renderItems($notice) { $mapping = ['getCote' => $this->_('Cote'), 'getSectionLabel' => $this->_('Section'), @@ -223,6 +236,12 @@ class ZendAfi_View_Helper_Notice_Unimarc extends Zend_View_Helper_HtmlElement { } + public function visitGuide($value) { + $this->_guide = $value; + return $this; + } + + protected function _tag() { return call_user_func_array([$this->view, 'tag'], func_get_args()); } @@ -264,16 +283,16 @@ class ZendAfi_View_Helper_Notice_UnimarcZone { public function renderField($name, $value, $first=false) { - return $this->view - ->tag('tr', - $this->_tag('td', $first ? $this->_label : '') - . $this->_tag('td', - $first - ? $this->_fields['indicateur1'] - . $this->_fields['indicateur2'] - : '') - . $this->_tag('td', $name) - . $this->_tag('td', $value) + return $this + ->_tag('tr', + $this->_tag('td', $first ? $this->_label : '') + . $this->_tag('td', + $first + ? $this->_fields['indicateur1'] + . $this->_fields['indicateur2'] + : '') + . $this->_tag('td', $name) + . $this->_tag('td', $value) ); } @@ -282,5 +301,3 @@ class ZendAfi_View_Helper_Notice_UnimarcZone { return call_user_func_array([$this->view, 'tag'], func_get_args()); } } - -?> \ No newline at end of file