diff --git a/VERSIONS b/VERSIONS index 5ec9cc63ad5942edecc833df58d8692d376abc12..273c6207194372582a1491c0b9ee0db189419358 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,3 +1,14 @@ +20/03/2017 - v7.9.7 + + - ticket #55821 : administration des suggestions d'achat: le lien pour envoyer un mail est compatible avec le client de messagerie Zimbra 7 + + - ticket #55110 : les vignettes des notices modifiées manuellement pour des ressources numériques sont sauvegardées correctement sur le serveur de cache mutualisé. + + - ticket #57170 : Correction de l'intégration d'une vignette pour une notice de périodique + + - ticket #57673 : correction d'affichage des annexes dans cosmogramme suite à la suppression d'une bibliothèque + + 13/03/2017 - v7.9.6 - ticket #56299 : Multimedia : Séparation des actions de login, réservations, etc... diff --git a/application/modules/admin/views/scripts/suggestion-achat/index.phtml b/application/modules/admin/views/scripts/suggestion-achat/index.phtml index ff3146a5b94ddf8d2eef7a1f1deec87ccade79d2..fe4a1c6274e10824148aa2cd0245f6eae05b7b72 100644 --- a/application/modules/admin/views/scripts/suggestion-achat/index.phtml +++ b/application/modules/admin/views/scripts/suggestion-achat/index.phtml @@ -33,7 +33,7 @@ $_actions = [$_edit_action, function($model) { return ($model->hasUserMail()) ? $this->boutonIco('type=MAIL', - 'mailto='.$model->getUserMail().'?Subject='.rawurlencode($this->_('Suggestion d\'achat:').' '.$model->getTitre())) + 'mailto='.$model->getUserMail().'?subject='.rawurlencode($this->_('Suggestion d\'achat:').' '.$model->getTitre())) : '';}, $_delete_action ]; diff --git a/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/AnnexeControllerTest.php b/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/AnnexeControllerTest.php index 6452cc73b3c14f74a1ac2e2e734b61a9cb5cfd73..49621af55141715845247ee69be3288b419f8e43 100644 --- a/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/AnnexeControllerTest.php +++ b/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/AnnexeControllerTest.php @@ -47,6 +47,13 @@ abstract class AnnexeControllerTestCase extends CosmoControllerTestCase { 'code' => 'ACY01', 'id_origine' => 'ACY-01', 'id_bib' => 56]); + + $this->fixture('Class_CodifAnnexe', + ['id' => 120, + 'libelle' => 'Annex lost', + 'code' => 'P01', + 'id_origine' => 'P01', + 'id_bib' => 666]); } } @@ -66,6 +73,12 @@ class AnnexeControllerIndexTest extends AnnexeControllerTestCase { } + /** @test */ + public function lostAnnexShouldBeInTable() { + $this->assertXPathContentContains('//table//td', 'Annex lost'); + } + + /** @test */ public function annexeAnnecyIdOrigineShouldBeInTable() { $this->assertXPathContentContains('//table//td', 'ACY-01'); diff --git a/library/Class/CodifAnnexe.php b/library/Class/CodifAnnexe.php index fa8d43557d61eaa6fafcfadc20c24b3b66fd74e3..d47686c67d56e4e5258ffd9c0be7e449ac217193 100644 --- a/library/Class/CodifAnnexe.php +++ b/library/Class/CodifAnnexe.php @@ -62,12 +62,16 @@ class Class_CodifAnnexe extends Storm_Model_Abstract { public function getMailIntBib() { - return $this->getIntBib()->getMail(); + return $this->hasIntBib() + ? $this->getIntBib()->getMail() + : ''; } public function getLibraryLabel() { - return $this->getIntBib()->getLabel(); + return $this->hasIntBib() + ? $this->getIntBib()->getLabel() + : ''; } diff --git a/library/Class/Notice.php b/library/Class/Notice.php index 70c206b0d85b27e619684820a97252f55678eca8..e26c8eeedd8414fe4b38761098606bb8b1be08cb 100644 --- a/library/Class/Notice.php +++ b/library/Class/Notice.php @@ -1636,14 +1636,6 @@ class Class_Notice extends Storm_Model_Abstract { } - /** - * return int identifiant type doc codifié Pergame - */ - public function getTypeDocPergame() { - return Class_TypeDoc::find($this->getTypeDoc())->toPergame(); - } - - /** * @param $noticeUnimarc Class_NoticeUnimarc * @category testing diff --git a/library/Class/Notice/Thumbnail/ProviderCacheServer.php b/library/Class/Notice/Thumbnail/ProviderCacheServer.php index 6aa4a7556d54560e56811c655d5719cafc42bc26..6548bf48271cad29e95f5b4e112531092542577a 100644 --- a/library/Class/Notice/Thumbnail/ProviderCacheServer.php +++ b/library/Class/Notice/Thumbnail/ProviderCacheServer.php @@ -38,19 +38,18 @@ class Class_Notice_Thumbnail_ProviderCacheServer protected function _getUrls() { $record = $this->_record; - $titre = $record->isPeriodique() - ? $record->getClefChapeau() - : $record->getTitrePrincipal(); - $numero = $record->isPeriodique() ? $record->getTomeAlpha() : ''; - $args = ["titre" => $titre, + $args = ["titre" => $record->getTitrePrincipal(), "auteur"=> $record->getAuteurPrincipal(), "isbn" => $record->getIsbn(), "ean" => $record->getEan(), "type_doc" => $record->getFamilleId(), "numero" => $numero]; + if ($record->isPeriodique()) + $args["clef_chapeau"] = $record->getClefChapeau(); + $response = Class_WebService_AllServices::runServiceGetUrlVignette($args); if ($response["statut_recherche"] != 2) diff --git a/library/Class/TypeDoc.php b/library/Class/TypeDoc.php index df315bedae228e6db52ed840b2861e9dd6535e11..09678a2dfd4a8de677c17372ac3e5c8876ec4c70 100644 --- a/library/Class/TypeDoc.php +++ b/library/Class/TypeDoc.php @@ -311,13 +311,6 @@ class Class_TypeDoc extends Storm_Model_Abstract { } - /** - * return int identifiant type doc codifié Pergame - */ - public function toPergame() { - return $this->getId(); - } - public function isRessourceNumerique() { return (($this->getId() >= Class_TypeDoc::LIVRE_NUM) && (!in_array($this->getId(),[static::ARTICLE, static::RSS, static::SITE]))) diff --git a/library/Class/WebService/AllServices.php b/library/Class/WebService/AllServices.php index 5da7a8c1236a268fb3baddc2eaa2786ac1b92558..92e62e910d33b22edb1c73d4b5f2e422de00a381 100644 --- a/library/Class/WebService/AllServices.php +++ b/library/Class/WebService/AllServices.php @@ -111,7 +111,7 @@ class Class_WebService_AllServices { $notice = Class_Notice::find($id); $result = static::runServiceAfiUploadVignette(array_filter(['isbn' => $notice->getIsbn(), 'ean' => $notice->getEan(), - 'type_doc' => $notice->getTypeDocPergame(), + 'type_doc' => $notice->getFamilleId(), 'titre' => $notice->getTitrePrincipal(), 'auteur' => $notice->getAuteurPrincipal(), 'image' => $url, diff --git a/library/startup.php b/library/startup.php index 24d0942deddcae77710c36ce7b633e5cbf3c9be4..27159851880dfd293485a31f6d8b68ef248cf918 100644 --- a/library/startup.php +++ b/library/startup.php @@ -83,7 +83,7 @@ class Bokeh_Engine { function setupConstants() { defineConstant('BOKEH_MAJOR_VERSION','7.9'); - defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.6'); + defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.7'); defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/'); diff --git a/tests/application/modules/admin/controllers/ModoControllerTest.php b/tests/application/modules/admin/controllers/ModoControllerTest.php index aaa4ed63000f0d3055fc82675955292a93abf3f7..4b99ca58da67275d410595855ab5101fc835811f 100644 --- a/tests/application/modules/admin/controllers/ModoControllerTest.php +++ b/tests/application/modules/admin/controllers/ModoControllerTest.php @@ -432,7 +432,7 @@ class ModoControllerSuggestionAchatActionTest extends ModoControllerSuggestionAc /** @test */ public function firstRowActionsShouldContainsLinkToMailUser() { - $this->assertXPath('//tbody//tr[1]//td//a[@href="mailto:ppoucet@afi.com?Subject=Suggestion%20d%27achat%3A%20Harry%20Potter"]'); + $this->assertXPath('//tbody//tr[1]//td//a[@href="mailto:ppoucet@afi.com?subject=Suggestion%20d%27achat%3A%20Harry%20Potter"]'); } diff --git a/tests/application/modules/admin/controllers/RecordsControllerTest.php b/tests/application/modules/admin/controllers/RecordsControllerTest.php index 2d62fafe9a8f2ffbd32ad472f3aedc5f1cfb8da2..21bdfe10a41ec5ffa40516f74fc3abb025679bb3 100644 --- a/tests/application/modules/admin/controllers/RecordsControllerTest.php +++ b/tests/application/modules/admin/controllers/RecordsControllerTest.php @@ -29,8 +29,13 @@ abstract class RecordsControllerTestCase extends Admin_AbstractControllerTestCas public function setUp() { parent::setUp(); + Class_TypeDoc::find(Class_TypeDoc::EPUB) + ->getCodifTypeDoc() + ->setFamilleId(Class_CodifTypeDoc::LIVRE) + ->save(); + $this->_notice = Class_Notice::newInstanceWithId(12345, ['isbn' => '0123456789', - 'type_doc' => Class_TypeDoc::LIVRE, + 'type_doc' => Class_TypeDoc::EPUB, 'url_vignette' => '', 'url_image' => '', 'titre_principal' => 'Harry Potter', diff --git a/tests/library/Class/NoticeTest.php b/tests/library/Class/NoticeTest.php index 80fc096d567320b9e70bbdd6e756daa404ac43ad..c51c9cbdcff14aa1c262b45612d5107301830eec 100644 --- a/tests/library/Class/NoticeTest.php +++ b/tests/library/Class/NoticeTest.php @@ -34,7 +34,9 @@ class NoticeFixtures extends TestFixtures { -class NoticeVignetteTest extends Storm_Test_ModelTestCase { +class NoticeVignetteTest extends ModelTestCase { + protected $_storm_default_to_volatile = true; + public function setUp() { parent::setUp(); @@ -56,7 +58,7 @@ class NoticeVignetteTest extends Storm_Test_ModelTestCase { ->touch('notice_2.png'); Class_WebService_Vignette::setFileSystem($this->_filesystem); - + Class_CosmoVar::setValueOf('url_services', 'http://cache.org'); $this->_notice_without_thumbnails = $this->fixture('Class_Notice', ['id' => 1, @@ -64,7 +66,6 @@ class NoticeVignetteTest extends Storm_Test_ModelTestCase { 'url_vignette' => '', 'url_image' => '']); - $this->_notice_inexisting_thumbnails = $this->fixture('Class_Notice', ['id' => 2, 'type_doc' => Class_TypeDoc::LIVRE, @@ -111,8 +112,11 @@ class NoticeVignetteTest extends Storm_Test_ModelTestCase { $preferences= [ 'thumbnail_fields' => '700-a;856-u']; - Class_Profil::getCurrentProfil() - ->setCfgModules(['recherche' => ['viewnotice'.Class_TypeDoc::DISQUE => $preferences]]); + $this->fixture('Class_Profil', + ['id' => 1, + 'libelle' => 'portail', + 'cfg_modules' => ['recherche' => ['viewnotice'.Class_TypeDoc::DISQUE => $preferences]]]) + ->beCurrentProfil(); $this->fixture('Class_Sitotheque', @@ -120,6 +124,17 @@ class NoticeVignetteTest extends Storm_Test_ModelTestCase { 'id_notice' => 5, 'titre' => 'LinuxFR', 'url' => 'http://www.linuxfr.org']); + + + $this->_serial_without_thumbnails = $this->fixture('Class_Notice', + ['id' => 9, + 'type_doc' => Class_TypeDoc::PERIODIQUE, + 'tome_alpha' => '123', + 'titre_principal' => 'Monde Diplo: mars 2017', + 'clef_chapeau' => 'Monde Diplo', + 'auteur_principal' => 'diplo', + 'url_vignette' => '', + 'url_image' => '']); } @@ -131,6 +146,7 @@ class NoticeVignetteTest extends Storm_Test_ModelTestCase { parent::tearDown(); } + /** @test */ public function withoutThumbnailFetchUrlVignetteShouldAnswerVignetteActionForAjax() { $this->assertContains('/recherche/vignette/clef/', @@ -148,6 +164,31 @@ class NoticeVignetteTest extends Storm_Test_ModelTestCase { } + + /** @test */ + public function serialWithThumbnailFetchUrlLocalVignetteShouldPassMainTitleAndCollectionKey() { + $this->_http_client + ->whenCalled('open_url') + ->with('http://cache.org?' + .'titre='.urlencode('Monde Diplo: mars 2017') + .'&auteur=diplo' + .'&type_doc=2' + .'&numero=123' + .'&clef_chapeau='.urlencode('Monde Diplo') + .'&src='.Class_WebService_AllServices::createSecurityKey() + .'&api=2.0' + .'&action=10') + ->answers(json_encode(['statut_recherche' => '0', + 'source' => 'Amazon', + 'vignette' => 'diplo.jpg', + 'image' => 'diplo.jpg'])) + ->beStrict(); + + $this->assertEquals('/temp/vignettes_titre/notice_9.png', + $this->_serial_without_thumbnails->fetchUrlLocalVignette()); + } + + /** @test */ public function withInexistingThumbnailFetchUrlVignetteShouldAnswerLocalUrl() { $this->assertFalse($this->_http_client->methodHasBeenCalled('open_url'));