Commit 010de29b authored by Patrick Barroca's avatar Patrick Barroca 😠
Browse files

Merge branch 'hotline' into 'master'

Hotline

See merge request !3401
parents a73246dd ff7a3355
Pipeline #9405 failed with stage
in 42 minutes and 15 seconds
- ticket #104562 : bibliothèque numérique, traitement par lot sur les collections : les albums modifiés sont indexés après validation si nécessaire
\ No newline at end of file
- ticket #104766 : Ajout d'actions dans l'interface d'administration "Types de documents" pour réinitialiser toutes les vignettes pour un type donné
\ No newline at end of file
- ticket #104907 : Vignettes notices : Ajout de règle de détection d'url de vignettes fournies par PMB
\ No newline at end of file
- ticket #105277 : Dilicom PNB, export CSV des prêts : ajout de la colonne "Bibliothèque" qui contient le libellé de la bibliothèque des abonnés
\ No newline at end of file
......@@ -23,6 +23,22 @@ class Admin_TypeDocsController extends ZendAfi_Controller_Action {
public function getPlugins() {
return ['ZendAfi_Controller_Plugin_ResourceDefinition_DocType',
'ZendAfi_Controller_Plugin_Manager_Manager'];
'ZendAfi_Controller_Plugin_Manager_DocType'];
}
public function resetThumbnailsAction() {
$id = $this->_getParam('id');
if (!$type_doc = Class_TypeDoc::find($id)) {
$this->_helper->notify($this->_('Type de document inconnu'));
return $this->_redirect('/admin/type-docs');
}
Zend_Registry::get('sql')->execute("update notices set url_vignette='', url_image='' where type_doc='" . $type_doc->getId() . "'");
$this->_helper->notify($this->_('Vignettes réinitialisées pour le type %s',
$type_doc->getLibelle()));
$this->_redirect('/admin/type-docs');
}
}
<?php
Class_ScriptLoader::getInstance()
->addSearchInputToContent($this->_('Filtrer les connecteurs '));
?>
<p><?php
echo $this->_("Bokeh s'interface avec un certain nombre de ressources numériques. Les ressources numérisées sont cataloguées dans le portail et indexées dans l’OPAC comme les notices du SIGB. Ce qui constitue la force et le caractère unique de Bokeh, est sa capacité à proposer une recherche fusionnée par un métamoteur qui interroge simultanément tous les fonds et tous les contenus.");
?></p>
......
<?php
echo $this->tagModelTable($this->type_docs,
[$this->_('Libellé'), $this->_('Famille')],
['label', 'libelle_famille'],
[ ['action' => 'edit' , 'content' => $this->boutonIco('type=edit')]],
'type_docs');
Class_ScriptLoader::getInstance()
->addSearchInputToContent($this->_('Filtrer les types de documents'));
$description = (new Class_TableDescription('type_docs'))
->addColumn($this->_('Libellé'), 'label')
->addColumn($this->_('Famille'), 'libelle_famille')
->addRowAction(function($model) { return $this->renderPluginsActions($model); });
echo $this->renderTable($description,
$this->type_docs);
?>
......@@ -151,7 +151,16 @@ class Class_Loan_Pnb extends Storm_Model_Abstract {
public function getBibliotheque() {
return '';
return $this->hasUser()
? $this->getUser()->getLibelleBib()
: '';
}
public function getUser() {
if ($user = parent::_get('user'))
return $user;
return Class_Users::findFirstBy(['idabon' => $this->getSubscriberId()]);
}
......
......@@ -24,7 +24,7 @@ abstract class Class_Notice_Thumbnail_ProviderAbstract {
const THUMBS_DIRECTORY = 'vignettes_titre/';
protected static $_default_image_factory;
protected $_filesystem, $_record;
protected $_record;
/** @category testing */
......@@ -40,8 +40,7 @@ abstract class Class_Notice_Thumbnail_ProviderAbstract {
}
public function __construct($filesystem, $record) {
$this->_filesystem = $filesystem;
public function __construct($record) {
$this->_record = $record;
}
......
......@@ -23,8 +23,24 @@
class Class_Notice_Thumbnail_ProviderAlbum
extends Class_Notice_Thumbnail_ProviderLocal {
use Trait_StaticFileSystem;
protected function _getOriginalUrlOrPath() {
return ($album = $this->_record->getAlbum()) && ($path = $album->getFirstImagePathFoundInResources())
? $path : null;
if (!$album = $this->_record->getAlbum())
return null;
if ($path = $album->getFirstImagePathFoundInResources())
return $path;
if (($path = $album->getVignettePath()) && $this->getFileSystem()->file_exists($path))
return $path;
if (!$url = $album->getPoster())
return null;
if ((new Class_WebService_BibNumerique_Vignette())->downloadPoster($album))
return $album->getVignettePath();
return null;
}
}
......@@ -21,7 +21,7 @@
class Class_Notice_Thumbnail_ProviderFactory {
public function newWith($file_system, $notice) {
public function newWith($notice) {
$mapping =
['Article' => function($record) { return $record->isArticleCms(); },
'Album' => function($record) { return $this->_isAlbum($record); },
......@@ -33,7 +33,7 @@ class Class_Notice_Thumbnail_ProviderFactory {
foreach ($mapping as $name => $closure)
if ($closure($notice)) {
$class_name = 'Class_Notice_Thumbnail_Provider' . $name;
return new $class_name($file_system, $notice);
return new $class_name($notice);
}
}
......
......@@ -26,7 +26,7 @@ class Class_Notice_Thumbnail_ProviderThirdParty
public function updateNotice() {
return ($url = $this->_getThirdPartyUrl())
? $this->_setRecordUrls($url)
: (new Class_Notice_Thumbnail_ProviderCacheServer($this->_filesystem, $this->_record))->updateNotice();
: (new Class_Notice_Thumbnail_ProviderCacheServer($this->_record))->updateNotice();
}
......
......@@ -37,7 +37,7 @@ class Class_TableDescription_PNBLoans extends Class_TableDescription {
->addColumn($this->_('Genre'), 'first_kind')
->addColumn($this->_('Section'), 'first_section')
->addColumn($this->_('Catégorie'), 'category')
;
->addColumn($this->_('Bibliothèque'), 'bibliotheque');
}
......
......@@ -20,8 +20,6 @@
*/
class Class_WebService_Vignette extends Class_WebService_Abstract {
use Trait_StormFileSystem;
const NO_DATA = 'NO';
public static function getClefControle() {
......@@ -49,7 +47,7 @@ class Class_WebService_Vignette extends Class_WebService_Abstract {
public function getThumbnailProviderFor($notice) {
$factory = new Class_Notice_Thumbnail_ProviderFactory();
return $factory->newWith($this->getFileSystem(), $notice);
return $factory->newWith($notice);
}
......
......@@ -439,7 +439,7 @@ class ZendAfi_Controller_Plugin_Manager_Album extends ZendAfi_Controller_Plugin_
unset($values['droits_precision']);
$values['droits'] = $form->isPublicDomain()
? $form->getPublicDomain()
? $album->getPublicDomain()
: $droits_precision;
$frbr_multi = $values['frbr_multi'];
......
<?php
/**
* Copyright (c) 2012-2020, 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_Controller_Plugin_Manager_DocType extends ZendAfi_Controller_Plugin_Manager_Manager {
public function getActions($model) {
return
[
['url' => '/admin/type-docs/edit/id/%s',
'icon' => 'edit',
'label' => $this->_('Modifier le type de document %s', $model->getLibelle())],
['url' => '/admin/type-docs/reset-thumbnails/id/%s',
'icon' => 'images',
'label' => $this->_('Réinitialiser les vignettes des notices de type %s', $model->getLibelle()),
'anchorOptions' => $this->_confirm($this->_('Êtes vous sûr(e) de réinitialiser l\'ensemble des vignettes des notices de type "%s" ?', $model->getLibelle()))],
['url' => '/recherche/simple/type_doc/%s',
'icon' => 'view',
'anchorOptions' => ['target' => '_blank'],
'label' => $this->_('Lancer une recherche de notices de type %s', $model->getLibelle())]
];
}
}
\ No newline at end of file
......@@ -38,4 +38,12 @@ class ZendAfi_Controller_Plugin_MultiSelection_Album extends ZendAfi_Controller_
return [];
}
protected function _doAfterSave($model) {
if (Class_Album::class !== get_class($model))
return;
$model->index();
}
}
\ No newline at end of file
......@@ -356,7 +356,7 @@ class ZendAfi_Form_Album extends ZendAfi_Form {
public function isPublicDomain() {
return Class_Album::getPublicDomain() == $this->droits->getValue();
return Class_Album::RIGHT_PUBLIC_DOMAIN_KEY == $this->droits->getValue();
}
......
......@@ -28,7 +28,9 @@ class ZendAfi_Form_TypeDocs_Edit extends ZendAfi_Form {
if (!$id_type_doc)
return $form;
$type_doc= Class_TypeDoc::find($id_type_doc);
if (!$type_doc = Class_TypeDoc::find($id_type_doc))
return $form;
if (!$type_doc->isRessourceNumerique())
return $form;
......
......@@ -28,6 +28,7 @@ class ZendAfi_Validate_VignetteUrl extends Zend_Validate_Abstract {
'\/cgi-bin\/koha\/opac-image\.pl\?thumbnail=',
'www\.adav-assoc\.com\/.*\/GetImage\/',
'\/dam_picture.php\?id=',
'\/getimage.php\?url_image=',
];
......
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