Commit 6a05f76e authored by Ghislain Loas's avatar Ghislain Loas

hotline #71669 improve error messages

parent 73c3573e
......@@ -108,11 +108,13 @@ class ZendAfi_View_Helper_DigitalResource_Dashboard extends ZendAfi_View_Helper_
protected function _renderRights() {
if (!$this->_config->isEnabled())
return '';
$html = [$this->_tag('h3',$this->_('Gestion des droits'))];
if (!$this->_config->isEnabled()) {
$html [] = $this->_tag('p', $this->_('Veuillez activer la ressource pour pouvoir gérer les droits d\'accès des groupes'), ['class' => 'error']);
return implode($html);
}
$groups = new Storm_Collection(Class_UserGroup::findAll());
$this->_permitted_groups = array_filter(
$groups
......@@ -160,13 +162,15 @@ class ZendAfi_View_Helper_DigitalResource_Dashboard extends ZendAfi_View_Helper_
protected function _renderSso() {
if(!$this->_permitted_groups)
return '';
$html = [$this->_tag('h3', $this->_('Diagnostique SSO'))];
if(!$this->_config->getSsoAction()) {
$html [] = $this->_tag('p', $this->_('Pas de connexion SSO pour cette ressource'), ['class' => 'error']) ;
$html [] = $this->_tag('p', $this->_('Cette ressource ne prend pas en charge la connexion SSO'), ['class' => 'error']) ;
return implode($html);
}
if(!$this->_permitted_groups) {
$html [] = $this->_tag('p', $this->_('Veuillez configurer les droits de cette ressource pour obtenir une connexion SSO'), ['class' => 'error']) ;
return implode($html);
}
......@@ -239,11 +243,18 @@ class ZendAfi_View_Helper_DigitalResource_Dashboard extends ZendAfi_View_Helper_
protected function _renderHarvest() {
if(!$batch_name = $this->_config->getBatch())
return '';
if(!$batch_name = $this->_config->getBatch()) {
$html [] = $this->_tag('p', $this->_('Cette ressource ne prend pas en charge le moissonnage'), ['class' => 'error']) ;
return implode($html);
}
$html = [$this->_tag('h3', $this->_('Diagnostique moissonnage'))];
if (!$this->_config->isEnabled()) {
$html [] = $this->_tag('p', $this->_('Veuillez activer la ressource pour pouvoir gérer le moissonage'), ['class' => 'error']);
return implode($html);
}
if(!$batch = Class_Batch::findFirstBy(['type' => $batch_name])) {
$html [] = $this->_tag('p', $this->_('Le moissonnage n\'est pas programmé'), ['class' => 'error'])
. $this->view->button((new Class_Entity())
......
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