Commit 8db2c4d1 authored by Patrick Barroca's avatar Patrick Barroca 🎮

hotline #71154 : inspector gadget refacte

parent 2f837271
......@@ -55,25 +55,16 @@ class ZendAfi_View_Helper_Notice_Dilicom extends ZendAfi_View_Helper_BaseHelper
protected function _renderAlbum() {
$fields =
[
'id' => $this->_('Identifiant interne Bokeh'),
'titre' => $this->_('Titre'),
'created_at' => $this->_('Date de création'),
'date_maj' => $this->_('Date de mise à jour'),
'id_origine' => $this->_('Identifiant externe Dilicom'),
'url_origine' => $this->_('Url de la ressource externe Dilicom'),
];
$lines = [];
foreach ($fields as $field => $label)
$lines[] = $this->_tag('tr',
$this->_tag('th', $label,
['scope' => 'row'])
. $this->_tag('td',
str_replace(['"', '\\'], '', json_encode($this->_album->callGetterByAttributeName($field), JSON_PRETTY_PRINT))));
return $this->_tag('table', implode('', $lines));
return $this->view->modelProperties($this->_album,
[
'id' => $this->_('Identifiant interne Bokeh'),
'titre' => $this->_('Titre'),
'created_at' => $this->_('Date de création'),
'date_maj' => $this->_('Date de mise à jour'),
'id_origine' => $this->_('Identifiant externe Dilicom'),
'url_origine' => $this->_('Url de la ressource externe Dilicom'),
])
;
}
......@@ -104,14 +95,15 @@ class ZendAfi_View_Helper_Notice_Dilicom extends ZendAfi_View_Helper_BaseHelper
$this->view->Album_UsageConstraints($constraints));
},
['id' => 'ig-tab-orders',
'class' => 'ig-accordion']);
'class' => 'ig-accordion'],
$this->_('Cet album n\'a pas de commande'));
}
protected function _withItemsDo($closure, $attribs) {
protected function _withItemsDo($closure, $attribs, $message) {
$content = ($items = $this->_album->getItems())
? implode(array_map($closure, $items))
: $this->_tag('p', $this->_('Cet album n\'a pas de commande'));
: $this->_tag('p', $message);
return $this->_tag('div', $content, $attribs);
}
......@@ -123,7 +115,8 @@ class ZendAfi_View_Helper_Notice_Dilicom extends ZendAfi_View_Helper_BaseHelper
return $this->view->Album_Loans($item);
},
['id' => 'ig-tab-loans',
'class' => 'ig-accordion']);
'class' => 'ig-accordion'],
$this->_('Cet album n\'a pas de prêt en cours'));
}
......
......@@ -61,15 +61,8 @@ class ZendAfi_View_Helper_Notice_Unimarc extends Zend_View_Helper_HtmlElement {
'url_vignette' => $this->_('Url vignette'),
'url_image' => $this->_('Url image'),
];
$lines = [];
foreach ($fields as $field => $label)
$lines[] = $this->_tag('tr',
$this->_tag('th', $label,
['scope' => 'row'])
. $this->_tag('td',
str_replace(['"', '\\'], '', json_encode($notice->callGetterByAttributeName($field), JSON_PRETTY_PRINT))));
return $this->_tag('table', implode('', $lines));
return $this->view->modelProperties($notice, $fields);
}
......
Markdown is supported
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