diff --git a/library/digital_resources/Bibliondemand/Lib/Context.php b/library/digital_resources/Bibliondemand/Lib/Context.php index a0557f91045bb497888987c07f7426b279c17e5c..b63a6208eff5df5b3dc70e01194e333a67dfb22b 100644 --- a/library/digital_resources/Bibliondemand/Lib/Context.php +++ b/library/digital_resources/Bibliondemand/Lib/Context.php @@ -234,9 +234,10 @@ class Bibliondemand_Lib_Context { } - public function whereRecordsWithDcType($dc_type_facet) { - return sprintf('MATCH (facettes) AGAINST (\'+%s +%s\' IN BOOLEAN MODE)', + public function whereRecordsWithDcTypeAndDocType($dc_type_facet, $doc_type_facet) { + return sprintf('MATCH (facettes) AGAINST (\'+%s +%s +%s\' IN BOOLEAN MODE)', $dc_type_facet, + $doc_type_facet, $this->getLibraryFacet()); } @@ -325,12 +326,13 @@ class Bibliondemand_Lib_Context { 'Thesaurus' => $this->_getDcTypeThesaurus() ->getOrCreateChild($dc_type, $dc_type)]); - + $doc_type = Class_TypeDoc::find($params['code']); $instance = $dc_types[$dc_type]; $instance - ->setFacets(implode(';', [$instance->getFacet(), $this->getLibraryFacet()])) - ->setDocTypes(array_unique(array_merge($instance->getDocTypes(), - [Class_TypeDoc::find($params['code'])->getLabel()]))) + ->setFacets(implode('-', [$instance->getFacet(), + $doc_type->asFacet(), + $this->getLibraryFacet()])) + ->setDocType($doc_type) ->collectMatchingProviders($this->getProviders()); } diff --git a/library/digital_resources/Bibliondemand/Lib/DcType.php b/library/digital_resources/Bibliondemand/Lib/DcType.php index aff9cf491a75c8e8666c32201d3a22d939de0549..852eb5eb0985931e5a2fc6869d5419bb1226a607 100644 --- a/library/digital_resources/Bibliondemand/Lib/DcType.php +++ b/library/digital_resources/Bibliondemand/Lib/DcType.php @@ -48,8 +48,19 @@ class Bibliondemand_Lib_DcType extends Class_Entity { if (null !== $this->getCount()) return $this->getCount(); - $this->setCount(count($this->_getMyRecordsIds())); - return $this->getCount(); + $count = count($this->_getMyRecordsIds()); + $this->setCount($count); + return $count; + } + + + public function getCountRecordsWithOutDocType() { + if (null !== ($count = $this->getCountWithOutDocType())) + return $count; + + $count = count($this->_getMyRecordsIdsWithOutDocType()); + $this->setCountWithOutDocType($count); + return $count; } @@ -58,10 +69,26 @@ class Bibliondemand_Lib_DcType extends Class_Entity { return $this->getMyRecordsIds(); $request = sprintf("select id_notice from notices where %s", - $this->getContext()->whereRecordsWithDcType($this->getFacet())); + $this->getContext()->whereRecordsWithDcTypeAndDocType($this->getFacet(), + $this->getDocType()->asFacet())); + + $result = (new Class_MoteurRecherche_Result(null, null))->fetchFromCache($request); + $this->setMyRecordsIds($result); + return $result; + } + + + protected function _getMyRecordsIdsWithOutDocType() { + if ($this->getMyRecordsIdsWithOutDocType()) + return $this->getMyRecordsIdsWithOutDocType(); + + $request = sprintf("select id_notice from notices where %s", + $this->getContext()->whereRecordsWithDcTypeAndDocType($this->getFacet(), + 'T0')); - $this->setMyRecordsIds((new Class_MoteurRecherche_Result(null, null))->fetchFromCache($request)); - return $this->getMyRecordsIds(); + $result = (new Class_MoteurRecherche_Result(null, null))->fetchFromCache($request); + $this->setMyRecordsIdsWithOutDocType($result); + return $result; } diff --git a/library/digital_resources/Bibliondemand/View/Helper/Dashboard.php b/library/digital_resources/Bibliondemand/View/Helper/Dashboard.php index 0ebec35936a0cac43a3ff8f52eb98a0d104ceb9a..78ea0fbca785e065e2369d8ed7297226ebf01d11 100644 --- a/library/digital_resources/Bibliondemand/View/Helper/Dashboard.php +++ b/library/digital_resources/Bibliondemand/View/Helper/Dashboard.php @@ -93,14 +93,22 @@ class Bibliondemand_View_Helper_Dashboard extends ZendAfi_View_Helper_BaseHelper function ($model) { return $model->getLabel();}) ->addColumn($this->_('Type de document Bokeh'), - function ($model) { return implode('; ', $model->getDocTypes());}) + function ($model) { return $model->getDocType()->getLabel();}) ->addColumn($this->_('Fournisseurs'), - function ($model) { return implode('; ', $model->getProviders());}) + function ($model) { return implode('; ', $model->getProviders());}) + + ->addColumn($this->_('Documents OK'), + function ($model) { return $model->getCountRecords();}) + + ->addColumn($this->_('Documents mal indexés'), + function ($model) + { + if (0 === ($count = $model->getCountRecordsWithOutDocType())) + return $count; + return $this->_tagError($count); + }) - ->addColumn($this->_('Nombre de documents'), - function ($model) { return $model->getCountRecords(); - }) ->addRowAction(function($model) { if (!$model->getCountRecords()) @@ -110,7 +118,7 @@ class Bibliondemand_View_Helper_Dashboard extends ZendAfi_View_Helper_BaseHelper [['url' => ['module' => 'opac', 'controller' => 'recherche', 'action' => 'simple', - 'facettes' => $model->getFacets()], + 'multifacets' => $model->getFacets()], 'icon' => 'view', 'anchorOptions' => ['target' => 'blank'], 'label' => $this->_('Voir les documents dans la recherche')]]); diff --git a/public/admin/skins/bokeh74/global.css b/public/admin/skins/bokeh74/global.css index 9ff4531f8ad8ea47a3de29fc18939be28ca3d2e6..7ff73d51c065ac787c9bf727bd4cadb3c57c9efc 100755 --- a/public/admin/skins/bokeh74/global.css +++ b/public/admin/skins/bokeh74/global.css @@ -224,6 +224,11 @@ a { font-weight: bold; } +td > p.error { + padding: 0; + margin: 0; +} + form .commentaire { font-size: 0.8em !important; }