Commit 1c66741b authored by Ghislain Loas's avatar Ghislain Loas

hotline #71669 change button to anchor

parent ee92dbae
......@@ -127,13 +127,13 @@ class ZendAfi_View_Helper_DigitalResource_Dashboard extends ZendAfi_View_Helper_
if (empty($this->_permitted_groups)) {
$html [] = $this->_tag('p', $this->_('Aucun groupe n\'a de droits d\'accès à la ressources'), ['class' => 'error'])
. $this->view->button((new Class_Entity())
->setText($this->_('Gérer les groupes'))
->setUrl($this->view->absoluteUrl(['module' => 'admin',
'controller' => 'usergroup',
'action' => 'index'],
null,
true)));;
. $this->view->tagAnchor($this->view->absoluteUrl(['module' => 'admin',
'controller' => 'usergroup',
'action' => 'index'],
null,
true),
$this->_('Gérer les groupes'),
['target' => '_blank']);
return implode($html);
}
......@@ -308,10 +308,24 @@ class ZendAfi_View_Helper_DigitalResource_Dashboard extends ZendAfi_View_Helper_
},
'anchorOptions' => ['data-popup' => 'true']],]);
});
$albums_link = ($cat = Class_AlbumCategorie::findFirstBy(['libelle' => $this->_config->getDocTypeLabel()]))
? $this->view->tagAnchor($this->view->absoluteUrl(['module' => 'admin',
'controller' => 'album',
'action' => 'index',
'cat_id' => $cat->getId()], null, true),
$this->_('Voir les albums'),
['target' => '_blank'])
: '';
if($batch)
$html [] = $this->view->renderTable($description, [new Class_Batch_Definition($this->_config->getBatchInstance())]);
$html [] = $this->_tag('p',
$this->_('Nombre d\'albums présents : %d', Class_Album::countBy(['type_doc_id' => $this->_config->getDocType()])));
$html [] = ($count = Class_Album::countBy(['type_doc_id' => $this->_config->getDocType()]))
? $this->_tag('p',
$this->_('Nombre d\'albums présents : %d', $count))
. $albums_link
: $this->_tag('p', $this->_('Aucun album présent pour cette ressource'), ['class' => 'error']);
return implode($html);
}
......
......@@ -526,13 +526,25 @@ class AssimilModuleIndexControllerTest extends AbstractControllerTestCase {
'code' => 'Assimil'])
->permitTo($group,
new Class_Entity());
$this->fixture('Class_AlbumCategorie',
['id' => 2,
'libelle' => 'ASSIMIL e-méthode',
]);
$this->fixture('Class_Album',
['id' => 1,
'titre' => 'album assimil',
'type_doc_id' => 'Assimil',
'cat_id' => 2
]);
}
/** @test */
public function indexActionShouldContainsNumberOfAlbums() {
$this->dispatch('/Assimil_Plugin/index', true);
$this->assertXPathContentContains('//p', 'Nombre d\'albums présents : 0', $this->_response->getBody());
$this->assertXPathContentContains('//p', 'Nombre d\'albums présents : 1');
}
......
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