Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
bibliossimo
opacce
Commits
964ad0d3
Commit
964ad0d3
authored
May 30, 2018
by
Ghislain Loas
Browse files
dev #75742 : Thesauri list view mode , edition and visualisation
parent
4de3c285
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
120 additions
and
4 deletions
+120
-4
application/modules/admin/views/scripts/thesauri/edit.phtml
application/modules/admin/views/scripts/thesauri/edit.phtml
+2
-0
library/Class/CodifThesaurus.php
library/Class/CodifThesaurus.php
+8
-0
library/ZendAfi/Controller/Plugin/Manager/Thesauri.php
library/ZendAfi/Controller/Plugin/Manager/Thesauri.php
+30
-2
library/ZendAfi/Form/Admin/Thesauri.php
library/ZendAfi/Form/Admin/Thesauri.php
+54
-0
library/ZendAfi/View/Helper/TagModelTable.php
library/ZendAfi/View/Helper/TagModelTable.php
+1
-1
public/admin/skins/bokeh74/form.css
public/admin/skins/bokeh74/form.css
+7
-0
tests/scenarios/Thesauri/ThesauriTest.php
tests/scenarios/Thesauri/ThesauriTest.php
+18
-1
No files found.
application/modules/admin/views/scripts/thesauri/edit.phtml
0 → 100644
View file @
964ad0d3
<?php
echo
$this
->
renderForm
(
$this
->
form
);
library/Class/CodifThesaurus.php
View file @
964ad0d3
...
...
@@ -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
();
}
...
...
library/ZendAfi/Controller/Plugin/Manager/Thesauri.php
View file @
964ad0d3
...
...
@@ -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
);
}
],
];
}
}
library/ZendAfi/Form/Admin/Thesauri.php
0 → 100644
View file @
964ad0d3
<?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
library/ZendAfi/View/Helper/TagModelTable.php
View file @
964ad0d3
...
...
@@ -56,5 +56,5 @@ class ZendAfi_View_Helper_TagModelTable extends ZendAfi_View_Helper_BaseHelper {
[
'sorter'
=>
$sorter
,
'pager'
=>
$pager
]);
}
}
n
}
?>
public/admin/skins/bokeh74/form.css
View file @
964ad0d3
...
...
@@ -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
);
...
...
tests/scenarios/Thesauri/ThesauriTest.php
View file @
964ad0d3
...
...
@@ -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"]'
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment