Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (34)
Showing
with 566 additions and 51 deletions
31/08/2020 - v8.0.76
- ticket #115965 : Profils : quand un profil a une "URL de la page" égale au premier terme du nom de domaine du site mais que la variabl NOM_DOMAINE contient cette URL, Bokeh ne redirige pas automatiquement vers ce profil
- ticket #113329 : Magasin de thèmes : correction de l'insertion du code de traçage statistique Google analytics et Matomo.
- ticket #115309 : Magasin de themes : le lien sur l'image de la notice dans les listes d'avis renvoient directement vers les avis de la notice.
- ticket #114417 : Magasin de thèmes : correction du libellé du lien menant à tous les tomes d'une collection
- ticket #110214 : Recherche avancée : correction de la validation du formulaire via la touche entrée
- ticket #115314 : Boite Biliothèque : amélioration du libellé de la prochaine ouverture
- ticket #98684 : Ressources numériques : amélioration de la compatibilité de l'export EAD pour Gallica
07/08/2020 - v8.0.75
- ticket #115759 : Magasin de thèmes : avatars de l'équipe : correction de l'affichage du premier avatar de la liste
- ticket #115393 : SIGB Nanook : correction des réservations lorsque plusieurs annexes sont rattachées à une même bibliothèque
- ticket #115685 : Menus : correction de la saisie d'URLs contenant des tirets bas _
- ticket #115024 : Magasin de thème : recherche avancée : ajout d'un paramètre pour basculer de profil pour afficher le résultat de recherche
- ticket #115024 : Magasin de thèmes : recherche avancée : ajout d'un paramètre pour basculer de profil pour afficher le résultat de recherche
05/08/2020 - v8.0.74
- ticket #115655 : Magasin thèmes : correction de la régression sur le paramètre d'affichage du lien "dissémination"
- ticket #115655 : Magasin de thèmes : correction de la régression sur le paramètre d'affichage du lien "dissémination"
- ticket #115609 : Magasin de thème : visualisation des notices : correction des liens des boutons suivant / précédent après visualisation du bloc description
......
- ticket #114294 : SIGB PMB : correction de lecture de caractères ISO2709
\ No newline at end of file
- ticket #114558 : Affichage de la notice : Correction de l'affichage du lien pour consulter les ressources Jumel
\ No newline at end of file
- ticket #115072 : [Magasin de thèmes] Ajout du flux RSS pour l'agenda
\ No newline at end of file
- ticket #115306 : Magasin de thèmes : amélioration de la performance d'affichage de la page mon compte / mes prêts
\ No newline at end of file
- ticket #116263 : Magasin de thèmes : correction du filtrage des articles selon leur statut lorsque le WORKFLOW est activé
\ No newline at end of file
- ticket #116443 : Gestion des zones de notes à l'affichage
\ No newline at end of file
- ticket #116552 : Magasin de thème : page blanche quand une boîte newsletter est incluse dans un menu de la page accueil
\ No newline at end of file
- ticket #116591 : Magasin Thème : amélioration de la maintenance des profils grâce à un système d'exportation et d'importation des données en JSON.
\ No newline at end of file
......@@ -161,8 +161,8 @@ class Admin_AlbumController extends ZendAfi_Controller_Action {
protected function _formExport($type='ead') {
return $this->view
->newForm(['id' => 'export_' . $type, 'class' => 'form'])
$form = $this->view
->newForm(['id' => 'export_' . $type, 'class' => 'admin-form'])
->setMethod('post')
->setAction($this->view->url(['action' => 'export-'.$type]))
->addElement('select',
......@@ -170,9 +170,18 @@ class Admin_AlbumController extends ZendAfi_Controller_Action {
['style' => 'max-width:445px;',
'allowEmpty' => false,
'required' => true,
'label' => $this->_('Catégorie à exporter'),
'multiOptions' => ['' => $this->_('Choisissez une catégorie')]
+ Class_AlbumCategorie::getAllLibelles()])
->addElement('submit', 'submit', ['label' => $this->_('Exporter en %s', strtoupper($type))]);
+ Class_AlbumCategorie::getAllLibelles()]);
if ($type === 'ead')
$form->addElement('checkbox', 'is_gallica', ['label' => $this->_('Format Gallica')]);
$form->addUniqDisplayGroup('common-' . $type,
['legend' => $this->_('Exporter en %s', strtoupper($type))]);
$form->addElement('submit', 'submit', ['label' => $this->_('Lancer l\'export')]);
return $form;
}
......@@ -187,23 +196,29 @@ class Admin_AlbumController extends ZendAfi_Controller_Action {
public function exportEadAction() {
$this->getHelper('ViewRenderer')->setNoRender();
$form = $this->_formExport();
if ($form->isValid($this->_request->getPost())) {
$this->getHelper('ViewRenderer')->setNoRender();
$response = $this->_response;
$response->clearAllHeaders();
$response->setHeader('Content-Type', 'application/xml; name="export_ead.xml"', true);
$response->setHeader('Content-Disposition', 'attachment; filename="export_ead.xml"', true);
$response->setHeader('Content-Transfer-Encoding', 'base64', false);
$response->setHeader('Expires', '0');
$response->setHeader('Cache-Control', 'no-cache, must-revalidate');
$response->setHeader('Pragma', 'no-cache');
$response->setHeader('Access-Control-Allow-Origin', '*');
$response->setBody($this->view->album_ExportEadVisitor((int)$this->_getParam('cat_id')));
if (!$form->isValid($this->_request->getPost())) {
$this->_helper->notify($this->_('Vous devez spécifier une catégorie à exporter'));
$this->_redirect('/admin/album/import_ead');
return;
}
$this->_helper->notify($this->_('Vous devez spécifier une catégorie à exporter'));
$this->_redirect('/admin/album/import_ead');
$response = $this->_response;
$response->clearAllHeaders();
$response->setHeader('Content-Type', 'application/xml; name="export_ead.xml"', true);
$response->setHeader('Content-Disposition', 'attachment; filename="export_ead.xml"', true);
$response->setHeader('Content-Transfer-Encoding', 'base64', false);
$response->setHeader('Expires', '0');
$response->setHeader('Cache-Control', 'no-cache, must-revalidate');
$response->setHeader('Pragma', 'no-cache');
$response->setHeader('Access-Control-Allow-Origin', '*');
$visitor = $this->_getParam('is_gallica')
? (new Class_AlbumCategorie_EadGallicaVisitor)
: (new Class_AlbumCategorie_EadVisitor);
$response->setBody($visitor->render(Class_AlbumCategorie::find((int) $this->_getParam('cat_id'))));
}
}
......@@ -550,6 +550,14 @@ class Admin_ProfilController extends ZendAfi_Controller_Action {
}
public function exportAction() {
$this->getHelper('ViewRenderer')->setNoRender();
$this->_response->setHeader('Content-Type', 'application/json');
$export = new Class_Profil_Export($this->_profil);
$this->_response->setBody($export->toString());
}
private function _splitArg($item) {
if (false === strpos($item, '='))
return false;
......
......@@ -6,4 +6,5 @@ echo $this->tag('p',
$this->_('ATTENTION : suivant la configuration de votre serveur d\'hébergement, l\'export de grandes collections peut échouer.'),
['class' => 'warning']);
echo $this->renderForm($this->form_export_ead);
echo $this->tag('hr');
echo $this->renderForm($this->form_export_csv);
......@@ -65,12 +65,12 @@ class AbonneController extends ZendAfi_Controller_Action {
protected function clearEmprunteurCache() {
$no_cache_actions = Class_Template::current()->isLegacy()
? ['prets', 'reservations', 'fiche', 'loans-history', 'ajax-loans', 'suggestions']
: ['fiche', 'loans-history', 'ajax-loans', 'suggestions'];
if (!in_array($this->getRequest()->getActionName(),
['prets',
'reservations',
'fiche',
'loans-history',
'suggestions']))
$no_cache_actions))
return;
foreach((new Class_User_Cards($this->_user)) as $user)
......@@ -428,17 +428,7 @@ class AbonneController extends ZendAfi_Controller_Action {
'start_issue_date' => $this->_getPost('start_issue_date'),
'end_issue_date' => $this->_getPost('end_issue_date')]);
$cards = new Class_User_Cards($this->_user);
$loans = $cards->getLoansWithOutPNB($this->_request->getParams());
$fiche = $this->_user->getFicheSigb();
$error = (isset($fiche['error']) && $fiche['error'])
? $fiche['error']
: '';
$this->view->config = new Class_Entity(['Loans' => $loans,
'RenewableLoansIds' => $cards->getRenewableLoansIds($loans),
'User' => $this->_user,
'Error' => $error,
$this->view->config = new Class_Entity(['User' => $this->_user,
'Profile' => Class_Profil::getCurrentProfil(),
'RequestParams' => $this->_request->getParams()]);
}
......@@ -492,6 +482,8 @@ class AbonneController extends ZendAfi_Controller_Action {
}
public function reservationsAction() {
$cards = new Class_User_Cards($this->_user);
......@@ -1949,7 +1941,6 @@ class AbonneController extends ZendAfi_Controller_Action {
$callback = function() {
return $this->view->abonne_AjaxLoans($this->_user);
};
return $this->_helper->ajax($callback);
}
......
......@@ -499,11 +499,7 @@ class NoticeAjaxController extends ZendAfi_Controller_Action {
if ((new Class_Notice_Sso($this->notice))->isValid())
return $this->_forward('sso-resources');
$first_item = $this->notice->getExemplaires()[0];
if ($url = $first_item->getUrl())
return $this->_forward('url-resources');
$first_item = $this->notice->getFirstExemplaire();
if ($bundle = $first_item->getBundle())
return $this->_forward('bundle-resources');
......@@ -514,13 +510,20 @@ class NoticeAjaxController extends ZendAfi_Controller_Action {
public function itemsResourcesAction() {
$callback = function() {
$items_loader = new Intonation_Library_Record_Items($this->notice);
return $this->view->RenderRecord_RenderItems($items_loader->findAll(),
$items_loader->findSameWork());
};
$record = new Intonation_Library_Record($this->notice);
return $this->_helper->ajax($callback);
if ($record->isExternalResource())
return $this->_helper->ajax(function() use ($record)
{
return $this->_getLinkOnline($record->getUrl());
});
$this->_helper->ajax(function() use ($record)
{
return $this->view->RenderRecord_RenderItems($record->getItemsFromSIGB(),
$record->getSameWorkItemsFromSIGB());
});
}
......@@ -540,13 +543,19 @@ class NoticeAjaxController extends ZendAfi_Controller_Action {
}
protected function _getLinkOnline($url) {
return $this->view->tagAnchor($url,
$this->view->_('Description en ligne'),
['class' => 'btn btn-lg btn-primary m-3']);
}
public function urlResourcesAction() {
$first_item = $this->notice->getExemplaires()[0];
$callback = function() use ($first_item) {
return $this->view->tagAnchor($first_item->getUrl(),
$this->view->_('Description en ligne'),
['class' => 'btn btn-lg btn-primary m-3']);
return $this->_getLinkOnline($first_item->getUrl());
};
return $this->_helper->ajax($callback);
......
......@@ -391,4 +391,30 @@ class PMBIntegrationRecordPeresEgliseTest extends PMBIntegrationRecordsTestCase
public function titresShouldContainsEGLISE() {
$this->assertContains('EGLISE EGLIS', $this->_record->getTitres());
}
}
class PMBIntegrationRecordTheologicoTest extends PMBIntegrationRecordsTestCase {
protected $_record;
public function setUp() {
parent::setUp();
$this->loadRecordsFromFile('unimarc_pmb_theologico');
$this->_record = Class_Notice::find(1);
}
/** @test */
public function titleShouldBeImaginationTheologicoPolitique() {
$this->assertContains('L\'imagination théologico-politique de l\'Eglise',
$this->_record->getTitrePrincipal());
}
/** @test */
public function subfield10DollarDShouldContains30Euros() {
$this->assertEquals('30€', $this->_record->get_subfield('010', 'd')[0]);
}
}
\ No newline at end of file
02863nam0 22002531i 450 001000700000100003500007009001500042200011300057010002900170101000800199215001700207330119300224319002801417700003501445210005201480225003401532410003401566896015001600995005001750996059701800610004902397606009402446606006902540100713 a20200619u u u0frey50  a2020-01-011 aL'imagination théologico-politique de l'Egliseevers une ecclésiologie narrative avec William T. Cavanaugh a978-2-204-13840-6d30€0 afre a348 p.din 8 aLa question du rapport de l'Église au monde est marquée par un double constat d'échec. D'un côté, la théologie politique a largement négligé le thème de l'Église ; de l'autre, la théologie récente l'a renvoyée aux domaines du droit et de l'éthique. Ainsi de nombreuses questions se posent : une théologie politique chrétienne est-elle réellement possible ? Les chrétiens sont-ils contraints à condamner le monde ou à le fuir ? Le religieux doit-il être inexorablement séparé de la sphère civile ? Comment l'Église participe-t-elle à l'avènement du Royaume de Dieu en ce monde ?
C'est à ces questions capitales que répond l'essai de Sylvain Brison en analysant comment la notion d'imagination implique un rapport renouvelé de l'Église au monde. En s'inscrivant dans la lignée du théologien William T. Cavanaugh, il explore la manière dont l'imagination à l'oeuvre dans l'Église opère une double fonction de critique du monde et de transformation de celui-ci en vue du Royaume de Dieu.
Cet essai passionnant constitue un traité exigeant sur la liberté, illustrant le devoir éthique et l'engagement moral des disciples de Jésus à réparer le monde.  aAucun droit spécifique 1aBrisonbSylvain40709id:43146 aParisbPariscÉditions du Cerfd20209id:111042 aCogitatio fideiv3109id:7853 0tCogitatio fideiv3109id:7853 agetimage.php?url_image=http%3A%2F%2Fimages-eu.amazon.com%2Fimages%2FP%2F%21%21isbn%21%21.08.MZZZZZZZ.jpg&noticecode=9782204138406&vigurl= aCAENcCAENf8/8946.310kC18 1(310)o1r1q1er f8/8946.310kC18 1(310)m00000000n00000000aCAENb2v Centre d'Etudes Théologiques de Caenx1ery1ereLivrer11Empruntable21319expl_id:9924989create_date:2020-06-19 15:22:239expl_cb:8/8946.3109expl_cote:C18 1(310)9expl_statut:19statut_libelle:Empruntable9statusdoc_codage_import:19expl_typdoc:19tdoc_libelle:Livre9tdoc_codage_import:19expl_section:319section_libelle:1er9sdoc_codage_import:1er9expl_owner:29lender_libelle:CAEN9codestat_libelle:CETH9statisdoc_codage_import:u9pret_flag:19location_libelle: Centre d'Etudes Théologiques de Caen9locdoc_codage_import:CAEN0 aRoyaume de Dieu;société civile;imagination 19id:110129lang:fr_FR9idthes:1aThéologie politique -- Église catholique -- 21e siècle 19id:56009lang:fr_FR9idthes:1aEglise et société - 21e siècle
\ No newline at end of file
......@@ -105,6 +105,8 @@ class Class_Album extends Storm_Model_Abstract {
const VIDEO_URL_FIELD = '856';
const VIDEO_URL_TYPE = 'video';
const DURATION_FIELD = '215$a';
const MISC_FIELD = '215$c';
const FORMAT_FIELD = '215$d';
const URI_TYPE_POSTER = 'poster';
const URI_TYPE_TRAILER = 'trailer';
const URI_TYPE_PHOTO = 'photo';
......@@ -1205,6 +1207,26 @@ class Class_Album extends Storm_Model_Abstract {
}
public function getMisc() {
return $this->getNote(self::MISC_FIELD);
}
public function setMisc($value) {
return $this->addNote(self::MISC_FIELD, $value);
}
public function getFormat() {
return $this->getNote(self::FORMAT_FIELD);
}
public function setFormat($format) {
return $this->addNote(self::FORMAT_FIELD, $format);
}
public function setNotes($array_or_string) {
return parent::setNotes($this->getMarc()->setDatas($array_or_string)->serialized());
}
......@@ -1465,6 +1487,14 @@ class Class_Album extends Storm_Model_Abstract {
}
public function acceptEadVisitor($visitor) {
foreach($this->getRessources() as $index => $ressource)
$visitor->visitRessource($ressource, $index);
Class_AlbumRessource::clearCache();
}
/**
* @return boolean
*/
......
......@@ -159,6 +159,16 @@ class Class_AlbumCategorie extends Storm_Model_Abstract {
protected $_default_attribute_values = ['parent_id' => 0];
public function acceptVisitor($visitor, $level=0) {
foreach($this->getAlbums() as $album)
$visitor->visitAlbum($album);
Class_Album::clearCache();
foreach($this->getSousCategories() as $category)
$visitor->visitCategory($category, $level + 1);
}
public function hasChildren() {
return $this->hasAlbums() or $this->hasSousCategories();
......
<?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 Class_AlbumCategorie_EadGallicaVisitor extends Class_AlbumCategorie_EadVisitor {
protected $_category;
const LEVEL_DESCRIPTIONS = ['collection', 'fonds', 'series', 'subseries'];
public function render($category) {
$this->_category = $category;
return parent::render($category);
}
public function visitCategory($category, $level = 0) {
if (0 === $level)
return $this->visitOriginCategory($category);
$descriptions_num_elmt = count(static::LEVEL_DESCRIPTIONS) - 1;
$level_name = $level > $descriptions_num_elmt
? static::LEVEL_DESCRIPTIONS[$descriptions_num_elmt]
: static::LEVEL_DESCRIPTIONS[$level];
$this->_xml_content .= '<c level="'. $level_name .'">'
. $this->_constructDidCategorie($category);
$category->acceptVisitor($this, $level);
$this->_xml_content .= '</c>';
return $this;
}
public function visitOriginCategory($category) {
$this->_xml_content .= '<archdesc level="' . static::LEVEL_DESCRIPTIONS[0] . '">'
. $this->_constructDidCategorie($category)
. '<dsc>';
$category->acceptVisitor($this, 0);
$this->_xml_content .= '</dsc></archdesc>';
return $this;
}
public function visitCustodhist($album) {
$b = $this->_builder;
return ($provenance = $album->getProvenance())
? $b->custodhist($b->p($b->cdata($provenance)))
: '';
}
public function visitUnitdate($album) {
return ($date = $album->getNote('305$a'))
? $this->_builder->unitdate(['normal' => str_replace('-', '', $date)], $date)
: '';
}
public function visitPhysdesc($album) {
$tab_physdesc = array_filter([$this->_propertyInTag([$album, 'getDuration'], 'extent'),
$this->_propertyInTag([$album, 'getMisc'], 'genreform'),
$this->_propertyInTag([$album, 'getFormat'], 'dimensions')]);
return $tab_physdesc
? $this->_builder->physdesc(implode(' ; ', $tab_physdesc))
: '';
}
public function visitUnitid($text, $type) {
return parent::visitUnitid($text, 'cote');
}
public function visitUnittitle($album) {
$b = $this->_builder;
$titre = $album->getTitre();
$titre .= $album->getSousTitre()
? ' : ' . $album->getSousTitre()
: '';
return $b->unittitle($b->cdata($titre));
}
public function visitAlbum($album) {
$this->_xml_content .= '<c id="'
. $album->getIdEad()
. '" level="item">'
. $this->_constructDid($album);
$album->acceptEadVisitor($this);
$this->_xml_content .= '</c>';
}
public function visitDescription($description) {
return $description
? $this->_builder->scopecontent($this->_builder->p(html_entity_decode($description)))
: '';
}
public function visitControlAccess($album) {
$content = array_filter([$this->visitAuthors($album),
$this->visitSubjects($album),
$this->visitGenres($album)]);
return implode($content);
}
public function visitAuthors($album) {
$b = $this->_builder;
return $this->implodeMap(
function($author) use ($b) {
return $b->controlaccess($b->persname(['normal' => $author->getName(),
'role' => $author->getResponsibility()],
$b->cdata($author->getName())
));
},
$album->getAuthors());
}
public function visitSubjects($album) {
$b = $this->_builder;
return $this->implodeMap(
function($matiere) use ($b) {
return $b->controlaccess(
$b->subject($b->cdata($matiere->getLibelle())));
},
Class_Matiere::findAllBy(['id_matiere' => explode(';', $album->getMatiere())])
);
}
public function visitRessource() {
}
public function visitGenres($album) {
return ($genre_ids = $album->getGenre())
? $this->implodeMap(
function($genre) {
return $this->buildGenreform($genre);
},
Class_CodifGenre::findAllBy(['id_genre' => explode(';',
$genre_ids)]))
: $this->buildGenreform('');
}
public function buildGenreform($genre){
$b = $this->_builder;
if ($genre)
return $b->controlaccess($b->genreform($b->cdata($genre->getLibelle())));
return $b->controlaccess($b->genreform(['type' => 'type de document', 'normal' => 'image fixe'],
'image fixe'
));
}
}
......@@ -19,16 +19,21 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Album_ExportEadVisitor extends Zend_View_Helper_Abstract {
protected $_builder;
class Class_AlbumCategorie_EadVisitor {
protected
$_builder,
$_xml_content;
public function album_exportEadVisitor($cat_id) {
public function render($category) {
if (!$category)
return '';
$this->_xml_content = '';
$this->_builder = new Class_Xml_Builder();
$categories = [Class_AlbumCategorie::find($cat_id)];
$xml_categories = $this->_constructXmlCategories($categories);
$xml_content = $this->_constructXml($xml_categories);
$this->visitCategory($category);
$xml_content = $this->_constructXml($this->_xml_content);
$dom = new DOMDocument();
$dom->preserveWhiteSpace = true;
$dom->loadXML($xml_content);
......@@ -38,14 +43,53 @@ class ZendAfi_View_Helper_Album_ExportEadVisitor extends Zend_View_Helper_Abstr
}
public function visitCategory($category) {
$this->_xml_content .= '<archdesc level="collection">'
. $this->_constructDidCategorie($category)
. '<dsc type="combined">';
$category->acceptVisitor($this);
$this->_xml_content .= '</dsc></archdesc>';
return $this;
}
public function visitAlbum($album) {
$this->_xml_content .= '<c01 id="'
. $album->getIdEad()
. '" level="file">'
. $this->_constructDid($album);
$album->acceptEadVisitor($this);
$this->_xml_content .= '</c01>';
}
public function visitRessource($ressource, $index) {
$this->_xml_content .= $this->_builder->c02(['id' => $ressource->getIdEad(),
'level' => 'otherlevel'],
$this->_constructDidC2($ressource));
}
public function visitUnitid($text, $type) {
return $this->_builder->unitid(['type'=> $type], $this->_builder->cdata($text));
}
public function _constructXml($content) {
$b = $this->_builder;
return '<?xml version="1.0" encoding="UTF-8"?>'."\n"
. $b->ead(['xmlns' => "urn:isbn:1-931666-22-9"],
$b->eadheader(['countryencoding' => 'utf8',
'repositoryencoding' => 'utf8',
'langencoding' => 'utf8'],
$b->eadheader(['countryencoding' => 'iso3166-1',
'dateencoding' => 'iso8601',
'repositoryencoding' => 'iso15511',
'langencoding' => 'iso639-2b',
'scriptencoding' => 'iso15924'],
$b->eadid(['countrycode' => 'FR'])
. $b->filedesc($b->titlestmt($b->titleproper($b->cdata('Bibliothèque numérique BOKEH'))
. $b->author($b->cdata($_SERVER['SERVER_NAME'])))
......@@ -54,112 +98,108 @@ class ZendAfi_View_Helper_Album_ExportEadVisitor extends Zend_View_Helper_Abstr
}
public function _constructAlbumsContent($categorie_id) {
$albums = Class_Album::findAllBy(['cat_id' => $categorie_id]);
$content = '';
$b = $this->_builder;
while (count($albums) > 0) {
$album = array_pop($albums);
$this->_ressources = [];
$album->acceptVisitor($this);
$content .= $b->c01(['id' => $album->getIdEad(),
'level' => 'file'],
$this->_constructDid($album)
. implode($this->_ressources));
public function visitDescription($description) {
return '';
}
Class_AlbumRessource::clearCache();
}
Class_Album::clearCache();
return $content;
public function _constructDidCategorie($categorie) {
$b = $this->_builder;
return $b->did($this->visitUnitid($categorie->getIdEad(), 'collection')
. $b->unittitle($b->cdata($categorie->getLibelle())));
}
protected function _constructXmlCategories($categories) {
$xml = '';
Class_AlbumCategorie::clearCache();
public function visitPhysdesc($album) {
$b = $this->_builder;
while (count($categories) > 0) {
$categorie = array_pop($categories);
$xml .= $b->archdesc(['level'=>'collection'],
$this->_constructDidCategorie($categorie).
$b->dsc(['type'=>'combined'],
$this->_constructAlbumsContent($categorie->getId())
.$this->_constructXmlCategories($categorie->getSousCategories())));
}
return $xml;
return $b->physdesc($b->physfacet(['type'=>'support'], $album->getNote('200$b'))
. $b->physfacet(['type'=>'reliure'], $album->getNote('316$a')));
}
public function _constructDidCategorie($categorie) {
public function visitUnittitle($album) {
$b = $this->_builder;
return $b->did($b->unitid(['type'=> 'collection'], $categorie->getIdEad())
. $b->unittitle($b->cdata($categorie->getLibelle())));
return $b->unittitle($b->cdata($album->getTitre()));
}
public function _constructDid($album) {
$b = $this->_builder;
$langue = $album->getLangue();
return $b
->did($b->unitid(['type'=> 'numéro_de_notice'], $album->getCote())
. $b->unittitle($b->cdata($album->getTitre()))
. $b->unitdate($album->getNote('305$a'))
. $b->langmaterial($b->language(['langcode' => $album->getIdLangue()]))
. $b->physdesc($b->physfacet(['type'=>'support'], $album->getNote('200$b'))
. $b->physfacet(['type'=>'reliure'], $album->getNote('316$a'))))
. $b->custodhist($b->p($b->cdata($album->getProvenance())))
. $this->_constructControlAccess($album->getMatiere(), $album);
->did($this->visitUnitid($album->getCote(), 'numéro_de_notice')
. $this->visitUnittitle($album)
. $this->visitUnitdate($album)
. ($langue
? $b->langmaterial($b->language(['langcode' => $langue->getId()],
$langue->getLibelle()))
: '')
. $this->visitPhysdesc($album))
. $this->visitDescription($album->getDescription())
. $this->visitCustodhist($album)
. $this->visitControlAccess($album);
}
protected function _constructControlAccess($matieres_str, $album) {
$controlaccess = '';
if (!isset($matieres_str))
return '';
public function visitUnitdate($album) {
$b = $this->_builder;
return $b->unitdate($album->getNote('305$a'));
}
public function visitCustodhist($album) {
$b = $this->_builder;
return $b->custodhist($b->p($b->cdata($album->getProvenance())));
}
$authors = implode('',
array_map(
function($author) use ($b) {
return $b->persname($b->cdata($author));
},
$album->getAuthorsNames()));
$subjects = implode('',
array_map(
function($matiere) use ($b) {
return $b->subject($b->cdata($matiere->getLibelle()));
},
Class_Matiere::findAllBy(['id_matiere' => explode(';', $matieres_str)])));
public function visitControlAccess($album) {
$content = array_filter([$this->visitSubjects($album),
$this->_propertyInTag([$album, 'getTitre'], 'title'),
$this->visitAuthors($album)]);
return $content
? $this->_builder->controlaccess(implode($content))
: '';
}
return $b->controlaccess($subjects
. $b->title($b->cdata($album->getTitre()))
. $authors);
public function visitAuthors($album) {
$b = $this->_builder;
return $this->implodeMap(
function($author) use ($b) {
return $b->persname($b->cdata($author));
},
$album->getAuthorsNames());
}
protected function _constructDidC2($ressource) {
public function visitSubjects($album) {
$b = $this->_builder;
return $this->implodeMap(
function($matiere) use ($b) {
return $b->subject($b->cdata($matiere->getLibelle()));
},
Class_Matiere::findAllBy(['id_matiere' => explode(';', $album->getMatiere())]));
}
return $b->did($b->unitid(['type'=> 'division'], $ressource->getFolio())
protected function _constructDidC2($ressource) {
$b = $this->_builder;
return $b->did($this->visitUnitid($ressource->getFolio(), 'division')
. $b->unittitle($b->cdata($ressource->getTitre())));
}
public function visitAlbum($album) {
public function implodeMap($callback, $values) {
return implode(array_map($callback, $values));
}
public function visitRessource($ressource, $index) {
$this->_ressources[] = $this->_builder->c02(['id' => $ressource->getIdEad(),
'level' => 'otherlevel'],
$this->_constructDidC2($ressource));
protected function _propertyInTag($callback, $tag) {
return ($value = $callback())
? $this->_builder->$tag($this->_builder->cdata($value))
: '';
}
}
\ No newline at end of file