Commit 964ad0d3 authored by Ghislain Loas's avatar Ghislain Loas

dev #75742 : Thesauri list view mode , edition and visualisation

parent 4de3c285
<?php
echo $this->renderForm($this->form);
......@@ -608,6 +608,14 @@ class Class_CodifThesaurus extends Storm_Model_Abstract {
return $this->getLoader()->findParent($this->getIdThesaurus());
}
public function getParentId() {
return $this->getParent()
? $this->getParent()->getId()
: null;
}
public function getTitre() {
return $this->getLibelleFacette();
}
......
......@@ -23,15 +23,43 @@
class ZendAfi_Controller_Plugin_Manager_Thesauri extends ZendAfi_Controller_Plugin_Manager_Manager {
public function getActions() {
public function getActions($model) {
if(!$model)
return [];
return [
['url' => $this->_view->url(['module' => 'admin',
'controller' => 'thesauri',
'action' => 'index',
'parent_id' => $model->getParentId(),
'id' => $model->getId()
],null,true),
'icon' => 'back',
'label' => $this->_('Afficher dans l\'arborescence '),
'condition' => function ($model) {
return $this->_getParam('title_search');
}
],
['url' => ['module' => 'admin',
'controller' => 'thesauri',
'action' => 'edit',
'id' => '%s'],
'icon' => 'edit',
'label' => $this->_('Modifier le thesaurus')],
];
['url' => ['module' => 'opac',
'controller' => 'recherche',
'action' => 'simple',
'facette' => $model->getFacetteIndex()
],
'icon' => 'view',
'label' => $this->_('Voir les documents rattachés au thésaurus "%s"',$model->getLibelleFacette()),
'anchorOptions' => ['target' => '_blank'],
'condition' => function ($model) {
return (strlen($model->getIdThesaurus()) > Class_CodifThesaurus::ID_KEY_LENGTH);
}
],
];
}
}
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_Form_Admin_Thesauri extends ZendAfi_Form {
public function init() {
parent::init();
$this->addElement('text',
'libelle',
['label' => $this->_('Libellé'),
'disabled' => 'disabled'])
->addElement('text',
'libelle_facette',
['label' => $this->_('Libellé facette')])
->addElement('text',
'code',
['label' => $this->_('Code'),
'disabled' => 'disabled'])
->addElement('text',
'id_thesaurus',
['label' => $this->_('Identifiant thésaurus'),
'disabled' => 'disabled'])
->addElement('text',
'rules',
['label' => $this->_('Règle'),
'disabled' => 'disabled'])
->addUniqDisplayGroup('thesauri');
}
}
?>
\ No newline at end of file
......@@ -56,5 +56,5 @@ class ZendAfi_View_Helper_TagModelTable extends ZendAfi_View_Helper_BaseHelper {
['sorter' => $sorter,
'pager' => $pager]);
}
}n
}
?>
......@@ -10,6 +10,13 @@
background: var(--widget-background);
}
.admin-form select:disabled,
.admin-form input:disabled {
background: var(--line-locked-highlight);
cursor: not-allowed;
}
.admin-form .input_connect_list h2 {
color: var(--main-text);
background: var(--main-background);
......
......@@ -154,4 +154,21 @@ class Thesauri_ThesauriIndexOrderTest extends Thesauri_ThesauriTestCase {
public function libelleFacetOrderLinkShouldDesc() {
$this->assertXpathContentContains('//table//a[contains(@href, "order/libelle_facette+desc")]', 'Libellé facette');
}
}
\ No newline at end of file
}
class Thesauri_ThesauriEditTest extends Thesauri_ThesauriTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/admin/thesauri/edit/id/3', true);
}
/** @test */
public function inputLibelleShouldContainsDocument() {
$this->assertXpath('//form//input[@value="Document"][@type="text"][@name="libelle"]');
}
}
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