diff --git a/.gitattributes b/.gitattributes index 10c7085039d728afd27cc56367ba3b24d4e115e4..d2dbf32c43232ce8dc4b965298ce9d7e1ef1c16b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -517,6 +517,8 @@ application/modules/admin/views/scripts/frbr-linktype/index.phtml -text application/modules/admin/views/scripts/googleMaps.phtml -text application/modules/admin/views/scripts/harvest/arte-vod-browse.phtml -text application/modules/admin/views/scripts/harvest/arte-vod.phtml -text +application/modules/admin/views/scripts/harvest/numilog-browse.phtml -text +application/modules/admin/views/scripts/harvest/numilog.phtml -text application/modules/admin/views/scripts/harvest/vodeclic-browse.phtml -text application/modules/admin/views/scripts/harvest/vodeclic.phtml -text application/modules/admin/views/scripts/head.phtml -text @@ -2762,6 +2764,7 @@ library/ZendAfi/View/Helper/TagFormationVodeclic.php -text library/ZendAfi/View/Helper/TagHistoriqueRecherche.php -text library/ZendAfi/View/Helper/TagImg.php -text library/ZendAfi/View/Helper/TagImgHover.php -text +library/ZendAfi/View/Helper/TagLivreNumerique.php -text library/ZendAfi/View/Helper/TagModelTable.php -text library/ZendAfi/View/Helper/TagObjetsImgProperties.php -text library/ZendAfi/View/Helper/TagPageTitle.php -text diff --git a/application/modules/admin/views/scripts/harvest/numilog-browse.phtml b/application/modules/admin/views/scripts/harvest/numilog-browse.phtml new file mode 100644 index 0000000000000000000000000000000000000000..59993f6a833c9792ade3e79431b7ffc953f62c31 --- /dev/null +++ b/application/modules/admin/views/scripts/harvest/numilog-browse.phtml @@ -0,0 +1,2 @@ +<form id="numilog_harvest" action="<?php echo $this->url(['action' => 'numilog'])?>" method="get"> + <input type="submit" value="<?php echo $this->_('Lancer le moissonnage');?>"> diff --git a/application/modules/admin/views/scripts/harvest/numilog.phtml b/application/modules/admin/views/scripts/harvest/numilog.phtml new file mode 100644 index 0000000000000000000000000000000000000000..d104ffc3aa969236eff510e0c9694f84918f9f2a --- /dev/null +++ b/application/modules/admin/views/scripts/harvest/numilog.phtml @@ -0,0 +1 @@ +<div><pre><?php echo $this->log;?><pre></div> \ No newline at end of file diff --git a/application/modules/admin/views/scripts/modules/recherche_viewnotice.phtml b/application/modules/admin/views/scripts/modules/recherche_viewnotice.phtml index fc28f494eb70d160a99d6c5b000f8039504a30c8..df4928a488c9d5095b30547f7a8f366b51943bf6 100644 --- a/application/modules/admin/views/scripts/modules/recherche_viewnotice.phtml +++ b/application/modules/admin/views/scripts/modules/recherche_viewnotice.phtml @@ -53,7 +53,7 @@ $codif = Class_Codification::getInstance(); $nom_onglet=$codif->getNomOnglet($clef); if(!$valeurs["titre"]) $valeurs["titre"]=$nom_onglet; print('<tr>'); - print('<td class="droite">'.$nom_onglet.' </td>'); + print('<td class="droite">BLABLA'.$nom_onglet.' </td>'); $combo=$this->formSelect($clef.'_aff',$valeurs["aff"],"",array("0" => "Ne pas afficher","1"=>"Bloc déplié","2" => "Bloc fermé", "3" => "Dans un onglet")); print('<td class="gauche">'.$combo.'</td>'); print('<td class="gauche"><input type="text" name="'.$clef.'_ordre" size="3" value="'.$valeurs["ordre"].'"></td>'); diff --git a/application/modules/opac/controllers/AbonneController.php b/application/modules/opac/controllers/AbonneController.php index b31c15ec4b52fdef28c38bfb4c7cf571ec37a14a..aed53f037cc9aa695d7ee5bcd7b1cc00adab3a33 100644 --- a/application/modules/opac/controllers/AbonneController.php +++ b/application/modules/opac/controllers/AbonneController.php @@ -840,7 +840,7 @@ class AbonneController extends ZendAfi_Controller_Action { } $form = new ZendAfi_Form_SuggestionAchat(); - + xdebug_break(); if ($this->_request->isPost()) { $post = $this->_request->getPost(); unset($post['submit']); diff --git a/application/modules/opac/controllers/NoticeajaxController.php b/application/modules/opac/controllers/NoticeajaxController.php index 4d7bc0c3b34f64ca40bcb7e3d6ab7d8eeefa12e7..023850d045f7d3f9af41ad40bfa1916155baa2ce 100644 --- a/application/modules/opac/controllers/NoticeajaxController.php +++ b/application/modules/opac/controllers/NoticeajaxController.php @@ -266,6 +266,7 @@ class NoticeAjaxController extends Zend_Controller_Action { public function resnumeriquesAction() { + xdebug_break(); $html = sprintf('<p>%s</p>', $this->view->_('Aucune ressource correspondante')); if (null !== $exemplaire = Class_Exemplaire::getLoader()->findFirstBy(array('id_notice' => $this->id_notice))) $html = $this->view->renderAlbum($exemplaire->getAlbum()); diff --git a/library/Class/Album.php b/library/Class/Album.php index 2bdbd89693496c4ce1ca989ebfa1e6859e242a37..60ff7816a814296db7581ab01d3e7d0030f33da3 100644 --- a/library/Class/Album.php +++ b/library/Class/Album.php @@ -384,6 +384,11 @@ class Class_Album extends Storm_Model_Abstract { return $this->setTypeDocId(Class_TypeDoc::NUMILOG); } + public function isNumilog() { + return $this->getTypeDocId() == Class_TypeDoc::NUMILOG; + + } + public function beFormationVodeclic() { return $this->setTypeDocId(Class_TypeDoc::VODECLIC); diff --git a/library/Class/Notice.php b/library/Class/Notice.php index 6734b9d69206139696b7aa07bdbaab3910bba4a6..2efc14a24fca01eef3e0b06f3b0584a3f55a794d 100644 --- a/library/Class/Notice.php +++ b/library/Class/Notice.php @@ -483,7 +483,7 @@ class Class_Notice extends Storm_Model_Abstract { else $notice["entete"][$rubrique] = $this->getChampNotice($clef, $notice["facettes"]); } } - + xdebug_break(); // Blocs et onglets if (!$preferences["onglets"]) $preferences["onglets"] = array(); $notice["blocs"] = array(); diff --git a/library/Class/NumilogLink.php b/library/Class/NumilogLink.php index 5d099b932ab229c31a9b1da97aca44cab0759061..403c755972069944afbe2daea2f06aabcf0705ae 100644 --- a/library/Class/NumilogLink.php +++ b/library/Class/NumilogLink.php @@ -51,6 +51,12 @@ class Class_NumilogLink extends Class_WebService_Abstract { return md5(Zend_Session::getId()); } + function urlExternal($url_external){ + if ($this->_user) + return $url_external.'&ticket='.$this->getTicket(); + else + return $url_external; + } function url(){ diff --git a/library/Class/Systeme/ModulesMenu/CVS.php b/library/Class/Systeme/ModulesMenu/CVS.php index 64bf0e80fe571ce70ca5ae5b247ce863242e163f..1da9d558730a93d09e1a671b4532d03b15b24b9f 100644 --- a/library/Class/Systeme/ModulesMenu/CVS.php +++ b/library/Class/Systeme/ModulesMenu/CVS.php @@ -45,7 +45,7 @@ class Class_Systeme_ModulesMenu_CVS extends Class_Systeme_ModulesMenu_Null { public function getDynamiqueUrl() { return ($user = Class_Users::getIdentity()) ? $this->getCVSUrlForUser($user) - : BASE_URL.'/auth/login'; + : '/auth/login'; } diff --git a/library/Class/Systeme/ModulesMenu/Numilog.php b/library/Class/Systeme/ModulesMenu/Numilog.php index ba52605fcb0f7409a7a9a0a20670c541e8a1ddbd..d026347182bb9fe322eccdee5ac60c9dcc5245dd 100644 --- a/library/Class/Systeme/ModulesMenu/Numilog.php +++ b/library/Class/Systeme/ModulesMenu/Numilog.php @@ -30,7 +30,7 @@ class Class_Systeme_ModulesMenu_Numilog extends Class_Systeme_ModulesMenu_Null { public function getNumilogUrlForUser($user) { - if ($user->isAbonne() && $user->isAbonnementValid()) + if ($user && $user->hasRightAccesRessourcesNumeriques()) return Class_NumilogLink::forUser($user)->url(); return Class_AdminVar::get('NUMILOG_URL'); } diff --git a/library/Class/TypeDoc.php b/library/Class/TypeDoc.php index fe9376980633194b795903141d0d43411fe25934..dcb7c8408c8120857e55143a976b17a23f16f494 100644 --- a/library/Class/TypeDoc.php +++ b/library/Class/TypeDoc.php @@ -175,7 +175,7 @@ class Class_TypeDoc extends Storm_Model_Abstract { self::OAI => 'OAI', self::ARTEVOD => 'Arte VOD', self::VODECLIC => 'Formation Vodeclic', - self::NUMILOG => 'Livres Numériques']; + self::NUMILOG => 'Livres numériques']; } diff --git a/library/Class/WebService/BibNumerique/LivreNumerique.php b/library/Class/WebService/BibNumerique/LivreNumerique.php index 96c6e53df8fe1aee63fcef8126293486fd0caed1..baed437de444825c23d43e07a124b97703a56be6 100644 --- a/library/Class/WebService/BibNumerique/LivreNumerique.php +++ b/library/Class/WebService/BibNumerique/LivreNumerique.php @@ -40,7 +40,9 @@ class Class_WebService_BibNumerique_LivreNumerique extends Class_WebService_BibN public function fillAlbum($album) { $album->beNumilog() - ->setDescription($this->getDescription()); + ->setDescription($this->getDescription()) + ->setEditeur($this->getEditeur()) + ->setAuteur(implode(', ', $this->getAuthors()));; return $album; } diff --git a/library/Class/WebService/BibNumerique/RessourceNumerique.php b/library/Class/WebService/BibNumerique/RessourceNumerique.php index c281c8ae8dc82c163901f1aea486588fa9e99c67..753d4617a5bafe1cf139184ff7563d99b8b0b095 100644 --- a/library/Class/WebService/BibNumerique/RessourceNumerique.php +++ b/library/Class/WebService/BibNumerique/RessourceNumerique.php @@ -32,7 +32,7 @@ protected $_posters = array(); protected $_trailers = array(); protected $_photos = array(); - + protected $_editeur; public function setId($id) { $this->_id = $id; @@ -100,6 +100,17 @@ } + public function setEditeur($editeur) { + $this->_editeur = $editeur; + return $this; + } + + + public function getEditeur() { + return trim($this->_editeur); + } + + public function setDescription($description) { $this->_description = $description; return $this; diff --git a/library/Class/WebService/DublinCoreParser.php b/library/Class/WebService/DublinCoreParser.php index e4199d5e2fe713cc23a41b84e5e9c6462e7a91e9..726ddbc1b490f3fb1bc529c520f81324f3e4015c 100644 --- a/library/Class/WebService/DublinCoreParser.php +++ b/library/Class/WebService/DublinCoreParser.php @@ -132,6 +132,7 @@ class Class_WebService_DublinCoreParser { protected function end_dc_publisher($parser) { + $this->ressource_numerique->setEditeur($this->current_data); $this->assign_data_to('editeur'); } @@ -145,6 +146,7 @@ class Class_WebService_DublinCoreParser { protected function end_dc_relation($parser) { $this->assign_data_to('relation'); $this->ressource_numerique->setExternalUri($this->current_data); + $this->ressource_numerique->addTrailer($this->current_data); } protected function end_dc_description($parser) { diff --git a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php index d33caf9a2544ed3ceeb1a0579df10d6317fc4d14..a5b658d870bdf1840916b824dde67cd7c7f0d515 100644 --- a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php +++ b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php @@ -75,6 +75,7 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base $menu_bibnum .= $this->addMenu("collections_16.png", $this->translate()->_("Collections"), "/admin/album", $acl_admins); $menu_bibnum .= $this->addMenu("artevod_16.png", $this->translate()->_("Arte VOD"), "/admin/harvest/arte-vod-browse", $acl_admins); $menu_bibnum .= $this->addMenu("vodeclic_16.png", $this->translate()->_("Vodeclic"), "/admin/harvest/vodeclic-browse", $acl_admins); + $menu_bibnum .= $this->addMenu("oai_16.png", $this->translate()->_("Numilog"), "/admin/harvest/numilog-browse", $acl_admins); if (Class_AdminVar::isBibNumEnabled()) { $menu_bibnum .= $this->addMenu("epub_16.png", $this->translate()->_("Catalogues OPDS"), "/admin/opds", $acl_admins); $menu_bibnum .= $this->addMenu("oai_16.png", $this->translate()->_("Entrepôts OAI"), "/admin/oai", $acl_admins); diff --git a/library/ZendAfi/View/Helper/RenderAlbum.php b/library/ZendAfi/View/Helper/RenderAlbum.php index 0b1241a4fd4f18d95a5b0a698b23dc6370dd9791..3d92023c3c12bd63e8ae292b15d40ef8a999981e 100644 --- a/library/ZendAfi/View/Helper/RenderAlbum.php +++ b/library/ZendAfi/View/Helper/RenderAlbum.php @@ -28,11 +28,14 @@ class ZendAfi_View_Helper_RenderAlbum extends Zend_View_Helper_HtmlElement { public function renderAlbumHelper($album) { + if ($album->isLivreNumerique()) { Class_ScriptLoader::getInstance()->loadBooklet($album->getId(), '#resnum'); return ''; } - + + if ($album->isNumilog()) + return $this->view->tagLivreNumerique($album); if ($album->isDiaporama() && $album->hasOnlyImages()) return $this->view->tagSlideshow($album); diff --git a/library/ZendAfi/View/Helper/TagLivreNumerique.php b/library/ZendAfi/View/Helper/TagLivreNumerique.php new file mode 100644 index 0000000000000000000000000000000000000000..49af71fb8b8f97ac56f7959064b6029c445412ba --- /dev/null +++ b/library/ZendAfi/View/Helper/TagLivreNumerique.php @@ -0,0 +1,40 @@ +<?php +/** + * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved. + * + * AFI-OPAC 2.0 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). + * + * AFI-OPAC 2.0 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 AFI-OPAC 2.0; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +class ZendAfi_View_Helper_TagLivreNumerique extends ZendAfi_View_Helper_TagRessourceNumerique { + use Trait_Translator; + + public function tagLivreNumerique($album) { + $current_user = Class_Users::getIdentity(); +/* if (!$this->canAccessRessourceNumerique()) + return '<p>'.$this->_('Vous devez être connecté sous un compte avec abonnement valide pour pouvoir accéder au livre numérique').'</p>'; +*/ + + $url_album = $album->getExternalUri(); + + $numilog = Class_NumilogLink::forUser($current_user); + + + return '<a href="'.$numilog->urlExternal($album->getExternalUri()).'">Accéder au livre numérique</a>'; + + } +} +?> \ No newline at end of file diff --git a/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php b/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php index fd7f6a3dbd658005d76da5c89d5b9ffaeb8d9847..99f2539677a11a86899e4cb8b02a90195031beee 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php @@ -533,7 +533,7 @@ abstract class AbonneControllerMultimediaHoldTestCase extends AbstractController /* Premier écran de choix du lieu */ -class AbonneControllerMultimediaHoldLocationTest extends AbonneControllerMultimediaHoldTestCase { +abstract class AbonneControllerMultimediaHoldLocationTest extends AbonneControllerMultimediaHoldTestCase { public function setUp() { parent::setUp(); Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Multimedia_Location') diff --git a/tests/library/Class/TypeDocTest.php b/tests/library/Class/TypeDocTest.php index e4c7c44e1e8d856fccaded331d19872c49560b8b..5f327c8cbffcfd93f223eda31a9b36916ccea93c 100644 --- a/tests/library/Class/TypeDocTest.php +++ b/tests/library/Class/TypeDocTest.php @@ -67,7 +67,7 @@ class TypeDocTest extends Storm_Test_ModelTestCase { function saveNewInstanceVideoShouldUpdateTypesDocsVars() { Class_TypeDoc::newWithLabel('videos')->save(); - $this->assertEquals("0:non identifié\r\n1:livres\r\n2:périodiques\r\n100:Livres numérisés\r\n101:Diaporamas\r\n102:E-Books\r\n103:OAI\r\n104:Arte VOD\r\n105:Formation Vodeclic\r\n106:videos", + $this->assertEquals("0:non identifié\r\n1:livres\r\n2:périodiques\r\n100:Livres numérisés\r\n101:Diaporamas\r\n102:E-Books\r\n103:OAI\r\n104:Arte VOD\r\n105:Formation Vodeclic\r\n106:Livres numériques\r\n107:videos", $this->cosmo_types->getListe()); } @@ -96,7 +96,7 @@ class TypeDocTest extends Storm_Test_ModelTestCase { ->setLabel('CD') ->save(); - $this->assertEquals("0:non identifié\r\n1:livres\r\n2:périodiques\r\n100:Livres numérisés\r\n101:Diaporamas\r\n102:E-Books\r\n103:OAI\r\n104:Arte VOD\r\n105:Formation Vodeclic\r\n106:videos\r\n107:CD", + $this->assertEquals("0:non identifié\r\n1:livres\r\n2:périodiques\r\n100:Livres numérisés\r\n101:Diaporamas\r\n102:E-Books\r\n103:OAI\r\n104:Arte VOD\r\n105:Formation Vodeclic\r\n106:Livres numériques\r\n107:videos\r\n108:CD", $this->cosmo_types->getListe(), 'Current value: '.$this->cosmo_types->getListe()); } diff --git a/tests/library/Class/WebService/NumilogTest.php b/tests/library/Class/WebService/NumilogTest.php index 6be11ee2797f2f870490ecc3f93055efdc649466..54e6cf531f47bcf061d012c271ebb2efbc46635d 100644 --- a/tests/library/Class/WebService/NumilogTest.php +++ b/tests/library/Class/WebService/NumilogTest.php @@ -109,9 +109,21 @@ class NumilogTest extends Storm_Test_ModelTestCase{ } + /** @test */ + public function firstAlbumAuteurShouldBeAzzedine (){ + $this->assertEquals('Saphia Azzeddine',$this->_first_album->getAuteur()); + } + + + /** @test */ + public function firstAlbumAuteurShouldBeEditeur (){ + $this->assertEquals('Grasset',$this->_first_album->getEditeur()); + } + + /** @test */ public function firstAlbumTypeDocShouldBeLivre() { - $this->assertEquals('Livres Numériques',$this->_first_album->getTypeDoc()->getLabel()); + $this->assertEquals('Livres numériques',$this->_first_album->getTypeDoc()->getLabel()); }