Skip to content
Snippets Groups Projects
Commit fd5176ae authored by Sebastien ANDRE's avatar Sebastien ANDRE
Browse files

Merge branch...

Merge branch 'dev#152314_ensa_possibilite_de_mettre_plusieurs_filtres_sur_les_domaines_dans_boite_recherche' into 'master'

dev #152314 Facets on domains

See merge request !4407
parents bbb73e0d f5e15337
Branches
Tags
1 merge request!4407dev #152314 Facets on domains
Pipeline #17376 passed with stage
in 1 hour, 46 minutes, and 20 seconds
Showing
with 143 additions and 64 deletions
variables: variables:
MYSQL_HOST: localhost__bokeh_mysql5 MYSQL_HOST: localhost__bokeh_mariadb_10.3
MYSQL_DATABASE: "bokeh_build_${CI_BUILD_REF}" MYSQL_DATABASE: "bokeh_build_${CI_BUILD_REF}"
MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_PASSWORD: root
...@@ -8,7 +8,7 @@ variables: ...@@ -8,7 +8,7 @@ variables:
test:php74: test:php74:
image: bokeh_php74_with_chrome image: bokeh_php74_with_chrome
services: services:
- localhost:5000/bokeh_mysql5 - localhost:5000/bokeh_mariadb_10.3
script: script:
- bash scripts/ci_data_preparation.sh $MYSQL_DATABASE $MYSQL_HOST $MYSQL_ROOT_PASSWORD - bash scripts/ci_data_preparation.sh $MYSQL_DATABASE $MYSQL_HOST $MYSQL_ROOT_PASSWORD
- bash build.sh $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD $MYSQL_HOST - bash build.sh $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD $MYSQL_HOST
...@@ -21,7 +21,7 @@ test:php74: ...@@ -21,7 +21,7 @@ test:php74:
test:php81: test:php81:
image: bokeh_php81 image: bokeh_php81
services: services:
- localhost:5000/bokeh_mysql5 - localhost:5000/bokeh_mariadb_10.3
script: script:
- bash scripts/ci_data_preparation.sh $MYSQL_DATABASE $MYSQL_HOST $MYSQL_ROOT_PASSWORD - bash scripts/ci_data_preparation.sh $MYSQL_DATABASE $MYSQL_HOST $MYSQL_ROOT_PASSWORD
- bash build.sh $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD $MYSQL_HOST - bash build.sh $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD $MYSQL_HOST
......
'152314' =>
['Label' => $this->_('Facettes dynamiques sur les domaines'),
'Desc' => $this->_('A l\'instar des facettes dynamiques sur les zones unimarc, Bokeh permet de définir des facettes dynamiques sur les domaines.
Par exemple, vous avez les regroupements suivants: domaine "Regarder un film" (DVD, Blu-ray, Vidéo en ligne), domaine "Lire" (Livre, Périodiques), domaine "Jouer" (Jeu vidéo, Jeu de société).
Vous pouvez alors créer une facette de dynamique Activité sur les domaines précédents. Cette facette s\'affichera alors en résultat de recherche et pourra s\'utiliser dans toutes les fonctionnalités basées sur des facettes.'),
'Image' => '',
'Video' => 'https://youtu.be/3Wp-eev4zks',
'Category' => $this->_('Recherche'),
'Right' => function($feature_description, $user) {return true;},
'Wiki' => 'https://wiki.bokeh-library-portal.org/index.php?title=Facettes_dynamiques_sur_les_domaines',
'Test' => '',
'Date' => '2022-03-03'],
\ No newline at end of file
...@@ -25,7 +25,7 @@ Les apports des versions sont consignés dans le fichier [VERSIONS de la racine ...@@ -25,7 +25,7 @@ Les apports des versions sont consignés dans le fichier [VERSIONS de la racine
Les dernières versions majeurs sont complétées par une [page dans le wiki](http://wiki.bokeh-library-portal.org/index.php/Category:Notes_de_version) qui apporte un éclairage plus fonctionnel aux ajouts des développements. Les dernières versions majeurs sont complétées par une [page dans le wiki](http://wiki.bokeh-library-portal.org/index.php/Category:Notes_de_version) qui apporte un éclairage plus fonctionnel aux ajouts des développements.
## Collecter les versions intermédiares ## Collecter les versions intermédaires
Si votre installation de BOKEH est très éloignés de la version que vous ciblez, il est probable que vous deviez d'abord mettre à jour votre installation vers des versions intermédiaires. Si votre installation de BOKEH est très éloignés de la version que vous ciblez, il est probable que vous deviez d'abord mettre à jour votre installation vers des versions intermédiaires.
...@@ -64,6 +64,10 @@ $ php scripts/upgrade_db.php ...@@ -64,6 +64,10 @@ $ php scripts/upgrade_db.php
# Informatins sur les versions # Informatins sur les versions
## MariaDB
Bokeh requiert a minima MariaDB 10.3
## Moteur PHP ## Moteur PHP
### PHP 5.6 ### PHP 5.6
......
- fonctionnalité #152314 : Facettes dynamiques sur les domaines. Possibilité de mettre plusieurs filtres sur les domaines dans la boite recherche (magasin de thèmes)
\ No newline at end of file
...@@ -82,8 +82,6 @@ class Admin_CatalogueController extends ZendAfi_Controller_Action { ...@@ -82,8 +82,6 @@ class Admin_CatalogueController extends ZendAfi_Controller_Action {
|| (null !== $params['id_bib'])) || (null !== $params['id_bib']))
? $this->_helper->ListViewMode_Catalogue($params) ? $this->_helper->ListViewMode_Catalogue($params)
: $this->_helper->ListViewMode_Library($params); : $this->_helper->ListViewMode_Library($params);
$this->renderScript('admin/listViewMode.phtml');
} }
......
...@@ -26,4 +26,4 @@ class Admin_ErrorController extends ZendAfi_Controller_Action { ...@@ -26,4 +26,4 @@ class Admin_ErrorController extends ZendAfi_Controller_Action {
$this->view->database = array_at('dbname', $this->view->database = array_at('dbname',
Zend_Db_Table::getDefaultAdapter()->getConfig()); Zend_Db_Table::getDefaultAdapter()->getConfig());
} }
} }
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2022, 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 Admin_FacetsController extends ZendAfi_Controller_Action {
public function getPlugins() {
return [ZendAfi_Controller_Plugin_ResourceDefinition_DynamicFacet_Domain::class,
ZendAfi_Controller_Plugin_Manager_DynamicFacet_Admin::class];
}
}
...@@ -220,7 +220,7 @@ class Admin_WidgetController extends ZendAfi_Controller_Action { ...@@ -220,7 +220,7 @@ class Admin_WidgetController extends ZendAfi_Controller_Action {
protected function _edit($instance) { protected function _edit($instance) {
if(!$instance = $instance if(!$widget = $instance
->setId($this->_getParam('id')) ->setId($this->_getParam('id'))
->setProfileId($this->_getParam('id_profil')) ->setProfileId($this->_getParam('id_profil'))
->setParent($this->_getParam('parent')) ->setParent($this->_getParam('parent'))
...@@ -229,7 +229,7 @@ class Admin_WidgetController extends ZendAfi_Controller_Action { ...@@ -229,7 +229,7 @@ class Admin_WidgetController extends ZendAfi_Controller_Action {
return $this->_redirectClose($this->_getReferer()); return $this->_redirectClose($this->_getReferer());
} }
return $this->_render($instance); return $this->_render($widget);
} }
...@@ -338,4 +338,4 @@ class Admin_WidgetController extends ZendAfi_Controller_Action { ...@@ -338,4 +338,4 @@ class Admin_WidgetController extends ZendAfi_Controller_Action {
$helper->performAction($this->_getParam('named')); $helper->performAction($this->_getParam('named'));
$this->_redirectToReferer(); $this->_redirectToReferer();
} }
} }
\ No newline at end of file
<?php <?php
Class_ScriptLoader::getInstance()->addSearchInputInPath($this->_('Filtrer les domaines '), 'ul li div'); echo $this->admin_DomainsMenu();
if (Class_Users::getIdentity()->hasRightAccessDomaines()) { ?> if (Class_AdminVar::isModuleEnabled('ENABLE_DOMAINS_PER_LIBRARIES')) {
<center> echo $this->admin_ListViewMode($this->list);
<div align="center"><br> return;
<?php echo $this->Button_New((new Class_Button) }
->setText($this->_('Ajouter un domaine')));?>
</div>
</center>
<?php } ?>
<div class="catalogues"> echo $this->admin_DomainsTree($this->catalogues,
<ul class="tree"> $this->plugins,
<?php $this->message);
echo $this->partialCycle('catalogue/_catalogue_row.phtml',
'catalogue',
$this->catalogues,
['first', 'second'],
['plugins' => $this->plugins]);?>
</ul>
<div class="clear"></div>
</div>
<p align="center" class="error"><?php echo $this->message; ?></p>
<?php if (Class_AdminVar::isOaiServerEnabled()) { ?>
<h3><?php echo $this->_('Serveur OAI');?></h3>
<div>Base URL: <input class="permalink"
value="<?php echo Class_WebService_OAI::baseURL(); ?>"
readonly="true"
size="100" /></div>
<?php } ?>
<?php
echo $this->renderForm($this->form);
<?php
echo $this->renderForm($this->form);
<?php
echo $this->admin_DomainsMenu();
echo $this->admin_DynamicFacets($this->thesauris);
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
class Cosmo_FacetsController extends ZendAfi_Controller_Action { class Cosmo_FacetsController extends ZendAfi_Controller_Action {
public function getPlugins() { public function getPlugins() {
return ['ZendAfi_Controller_Plugin_ResourceDefinition_DynamicFacet', return [ZendAfi_Controller_Plugin_ResourceDefinition_DynamicFacet_Unimarc::class,
'ZendAfi_Controller_Plugin_Manager_DynamicFacet']; ZendAfi_Controller_Plugin_Manager_DynamicFacet_Cosmo::class];
} }
} }
<?php <?php
echo $this->tag('h1', $this->titre); echo $this->tag('h1', $this->titre);
echo $this->Button_New((new Class_Button) echo $this->admin_DynamicFacets($this->thesauris);
->setText($this->_('Ajouter une facette dynamique')));
$description = (new Class_TableDescription('facets'))
->addColumn($this->_('Libellé'), 'libelle')
->addRowAction(function($batch)
{
return $this->renderPluginsActions($batch);
})
;
echo $this->renderTable($description, $this->thesauris);
...@@ -24,17 +24,26 @@ class Cosmo_DynamicFacetsControllerIndexTest extends CosmoControllerTestCase { ...@@ -24,17 +24,26 @@ class Cosmo_DynamicFacetsControllerIndexTest extends CosmoControllerTestCase {
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
$this->fixture('Class_CodifThesaurus', $this->fixture(Class_CodifThesaurus::class,
['id' => 3, ['id' => 3,
'libelle' => 'Document', 'libelle' => 'Document',
'libelle_facette' => 'Document', 'libelle_facette' => 'Document',
'id_thesaurus' => 'DOCU', 'id_thesaurus' => 'DOCU',
'id_origine' => null, 'id_origine' => null,
'code' => 'DOCU', 'code' => Class_CodifThesaurusFixed::CODE_UNIMARC_FACET,
'rule_list_zone' => ['345'], 'rule_list_zone' => ['345'],
'rule_list_label_field' => ['t'], 'rule_list_label_field' => ['t'],
'rule_list_id_field' => ['9']]); 'rule_list_id_field' => ['9']]);
$this->fixture(Class_CodifThesaurus::class,
['id' => 4,
'libelle' => 'Document Domain',
'libelle_facette' => 'Document Domain',
'id_thesaurus' => 'DOMA',
'id_origine' => null,
'code' => Class_CodifThesaurusFixed::CODE_DOMAIN_FACET,
'rule_list_domain_id' => ['12']]);
$this->dispatch('/cosmo/facets/index'); $this->dispatch('/cosmo/facets/index');
} }
...@@ -67,6 +76,12 @@ class Cosmo_DynamicFacetsControllerIndexTest extends CosmoControllerTestCase { ...@@ -67,6 +76,12 @@ class Cosmo_DynamicFacetsControllerIndexTest extends CosmoControllerTestCase {
public function documentDeleteLinkShouldBeDisplayed() { public function documentDeleteLinkShouldBeDisplayed() {
$this->assertXpath('//td//a[contains(@href, "/facets/delete/id/3")]'); $this->assertXpath('//td//a[contains(@href, "/facets/delete/id/3")]');
} }
/** @test */
public function documentDomainShouldNotBeDisplayed() {
$this->assertNotXPath('//td[@text()="Document Domain"]');
}
} }
...@@ -168,6 +183,13 @@ class Cosmo_DynamicFacetsControllerAddPostValidTest extends CosmoControllerTestC ...@@ -168,6 +183,13 @@ class Cosmo_DynamicFacetsControllerAddPostValidTest extends CosmoControllerTestC
} }
/** @test */
public function facetCodeShouldBeDefaultUNIMARC() {
$this->assertEquals(Class_CodifThesaurusFixed::CODE_UNIMARC_FACET,
$this->model->getCode());
}
/** @test */ /** @test */
public function idThesaurusShouldBeNEWF() { public function idThesaurusShouldBeNEWF() {
$this->assertEquals('NEWF', $this->model->getIdThesaurus()); $this->assertEquals('NEWF', $this->model->getIdThesaurus());
...@@ -316,7 +338,7 @@ class Cosmo_DynamicFacetsControllerEditTest extends CosmoControllerTestCase { ...@@ -316,7 +338,7 @@ class Cosmo_DynamicFacetsControllerEditTest extends CosmoControllerTestCase {
'libelle_facette' => 'Document', 'libelle_facette' => 'Document',
'id_thesaurus' => 'DOCU', 'id_thesaurus' => 'DOCU',
'id_origine' => null, 'id_origine' => null,
'code' => 'DOCU', 'code' => Class_CodifThesaurusFixed::CODE_UNIMARC_FACET,
'rule_list_zone' => ['345'], 'rule_list_zone' => ['345'],
'rule_list_label_field' => ['t'], 'rule_list_label_field' => ['t'],
'rule_list_id_field' => ['9']]); 'rule_list_id_field' => ['9']]);
...@@ -359,6 +381,12 @@ class Cosmo_DynamicFacetsControllerEditTest extends CosmoControllerTestCase { ...@@ -359,6 +381,12 @@ class Cosmo_DynamicFacetsControllerEditTest extends CosmoControllerTestCase {
public function idThesaurusShouldBeDocu() { public function idThesaurusShouldBeDocu() {
$this->assertXPath('//input[@name="id_thesaurus"][@value="DOCU"]'); $this->assertXPath('//input[@name="id_thesaurus"][@value="DOCU"]');
} }
/** @test */
public function pageShouldNotContainsDomainsSelection() {
$this->assertNotXPath('//div[contains(@class, "treeselect")]');
}
} }
...@@ -500,6 +528,13 @@ class Cosmo_DynamicFacetsControllerPostWithManyRulesTest extends CosmoController ...@@ -500,6 +528,13 @@ class Cosmo_DynamicFacetsControllerPostWithManyRulesTest extends CosmoController
public function datasFromRuleListShouldBeTableTypeWithValues($field, $value) { public function datasFromRuleListShouldBeTableTypeWithValues($field, $value) {
$this->assertSame($value, $this->_facet_multi->callGetterByAttributeName($field)); $this->assertSame($value, $this->_facet_multi->callGetterByAttributeName($field));
} }
/** @test */
public function thesaurusShouldBeCreatedWithDefaultCodeUNIMARC() {
$this->assertEquals(Class_CodifThesaurusFixed::CODE_UNIMARC_FACET,
$this->_facet_multi->getCode());
}
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* *
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software * along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
// FICHE TRANSACTION ( Pret / réservation) // FICHE TRANSACTION ( Pret / réservation)
...@@ -83,6 +83,8 @@ class transaction ...@@ -83,6 +83,8 @@ class transaction
if((int)$enreg["ORDREABON"] <1 ) $enreg["ORDREABON"]=1; if((int)$enreg["ORDREABON"] <1 ) $enreg["ORDREABON"]=1;
$enreg["DATE_PRET"]=rendDate($enreg["DATE_PRET"], 0); $enreg["DATE_PRET"]=rendDate($enreg["DATE_PRET"], 0);
$enreg["DATE_RETOUR"]=rendDate($enreg["DATE_RETOUR"], 0); $enreg["DATE_RETOUR"]=rendDate($enreg["DATE_RETOUR"], 0);
// maria_db 10.3 expects an int
$enreg["NB_PROLONGATIONS"] = (int)$enreg["NB_PROLONGATIONS"];
// Ecrire // Ecrire
global $sql; global $sql;
...@@ -174,7 +176,7 @@ class transaction ...@@ -174,7 +176,7 @@ class transaction
} }
return $result; return $result;
} }
} }
?> ?>
\ No newline at end of file
...@@ -252,7 +252,13 @@ if (!$should_skip_records) { ...@@ -252,7 +252,13 @@ if (!$should_skip_records) {
// ---------------------------------------------------------------- // ----------------------------------------------------------------
startIntegrationPhase('AutocompleteBatchs'); startIntegrationPhase('AutocompleteBatchs');
// ----------------------------------------------------------------
// Facets on domains (phase 7.2)
// ----------------------------------------------------------------
startIntegrationPhase('DynamicFacetsOnDomainIndex');
} }
$phase = 7.5; $phase = 7.5;
// ---------------------------------------------------------------- // ----------------------------------------------------------------
...@@ -307,7 +313,7 @@ if ($phase==16 or $phase==17) { ...@@ -307,7 +313,7 @@ if ($phase==16 or $phase==17) {
// ---------------------------------------------------------------- // ----------------------------------------------------------------
if ($phase==17 or $phase==18) { if ($phase==17 or $phase==18) {
startIntegrationPhase('BookmarkedSearches'); startIntegrationPhase('BookmarkedSearches');
$phase=20; $phase=20;
} }
......
<?php <?php
(new Class_Migration_DigitalResource_Numilog)->run(); (new Class_Migration_DigitalResource_Numilog)->run();
\ No newline at end of file
<?php
$adapter = Zend_Db_Table::getDefaultAdapter();
try {
$all_unimarc_root = array_map(fn($row) => $row['code'],
$adapter->fetchAll('select distinct code from codif_thesaurus where code != "DOMAIN" and rules is not null and rules != ""'));
if ($all_unimarc_root) {
$query = 'update codif_thesaurus set code = "UNIMARC" where code in ("'
. implode('", "', $all_unimarc_root) . '")';
$adapter->query($query);
}
} catch(Exception $e) {}
...@@ -103,9 +103,12 @@ class Class_Admin_Skin { ...@@ -103,9 +103,12 @@ class Class_Admin_Skin {
public function renderMenuIconOn($name, $view, $attribs = []) { public function renderMenuIconOn($name, $view, $attribs = []) {
if (!$src = $this->getIconUrl('icons', $name)) if (!trim($name))
return ''; return '';
if (!$src = $this->getIconUrl('icons', $name))
return $view->renderIcon($name, $attribs);
return $view->tagImg($src,$attribs); return $view->tagImg($src,$attribs);
} }
...@@ -216,4 +219,4 @@ class Class_Admin_Skin { ...@@ -216,4 +219,4 @@ class Class_Admin_Skin {
protected function _getSkinPath() { protected function _getSkinPath() {
return static::_rootPath() . static::DEFAULT_ADMIN_PATH . $this->getName() . '/'; return static::_rootPath() . static::DEFAULT_ADMIN_PATH . $this->getName() . '/';
} }
} }
\ No newline at end of file
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