diff --git a/VERSIONS b/VERSIONS index ed1092ee825cf9b1c96e4ec209dfc609d1605cf6..7af75dfd8856749c634f01f4cab369bf772dfa5b 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,18 +1,30 @@ +19/10/2015 - v7.3.17 + + - ticket #30479 : Erreur à l'affichage des plans de localisation. + + - ticket #30520 : CCEG : Ouvrir les lien sitothèque dans un nouvel onglet + + - ticket #30015 : Pas de lien de retour vers le front ou vers le back office depuis l'explorateur de fichiers + + - ticket #26494 : Filtre bibliothèque collant dans la boite de recherche simple + + + 12/10/2015 - v7.3.16 - - ticket #29558 : recherche: les facettes sont remontées entièrement, amélioration des performances + - ticket #29558 : recherche: les facettes sont remontées entièrement, amélioration des performances - - ticket #30487 : Inspector gadget fonctionne après une redirection. + - ticket #30487 : Inspector gadget fonctionne après une redirection. - - ticket #30608 : Correction de l'affichage de la disponibilité des exemplaires dans un résultat de recherche. + - ticket #30608 : Correction de l'affichage de la disponibilité des exemplaires dans un résultat de recherche. - - ticket #29412 : images des articles dans le résultat de recherche + - ticket #29412 : images des articles dans le résultat de recherche - - ticket #29887 : PNB Dilicom Prise en compte des retours anticipés dans les compteurs de prêts + - ticket #29887 : PNB Dilicom Prise en compte des retours anticipés dans les compteurs de prêts - - ticket #25588 : Compte utilisateur : historique de prêts provenant de Koha + - ticket #25588 : Compte utilisateur : historique de prêts provenant de Koha - - ticket #30143 : En l'absence de vignette définie pour un album de la bibliothèque numérique, Bokeh utilise la première image trouvée dans cet album comme vignette du résultat de recherche + - ticket #30143 : En l'absence de vignette définie pour un album de la bibliothèque numérique, Bokeh utilise la première image trouvée dans cet album comme vignette du résultat de recherche - ticket #19211 : Possibilité de configurer des champs unimarc dans lesquels rechercher l'url de la vignette de la notice diff --git a/application/modules/opac/controllers/BibController.php b/application/modules/opac/controllers/BibController.php index 9a394d15649b03d3d98b4c632f34fa5e1e99c2d2..b444b8d60f11ec268a1b0dc34b57489aa55d5229 100644 --- a/application/modules/opac/controllers/BibController.php +++ b/application/modules/opac/controllers/BibController.php @@ -99,7 +99,9 @@ class BibController extends ZendAfi_Controller_Action { if(false === strpos($this->_getReferer(), '/recherche/simple')) return $this->_redirectToReferer(); - return $this->_redirectToRefererWithNewParams(['bib_select' => implode(',',$id_bibs)]); + $bib_select = implode(',',$this->view->id_bibs_session); + return $this->_redirectToRefererWithNewParams(['bib_select' => ($bib_select === '' + ? null : $bib_select)]); } } diff --git a/application/modules/opac/views/scripts/bib/selection.phtml b/application/modules/opac/views/scripts/bib/selection.phtml index 54c0ae2059cec6bb47a49a004a7a8d85e296e118..3c849acb8c5a6f9173b4986cb949e70a4c1127bd 100644 --- a/application/modules/opac/views/scripts/bib/selection.phtml +++ b/application/modules/opac/views/scripts/bib/selection.phtml @@ -6,6 +6,7 @@ $html .= $this->tag('p', $form_content = $this->formSubmit('Valider', $this->_('Valider la sélection')); $form_content .= $this->tagAnchor('javascript:selectall()', $this->_('Tout cocher')); $form_content .= $this->tagAnchor('javascript:deselectall()', $this->_('Tout décocher')); +$form_content .= $this->formHidden('update_bib_select', '1'); $form_li = ''; foreach($this->zones as $zone ) { @@ -16,7 +17,9 @@ foreach($this->zones as $zone ) { foreach($bibs as $bib) { $coche = in_array($bib->getId(), $this->id_bibs_session) ? ['checked' => 'checked'] : []; $form_li_li .= $this->tag('li', - $this->formCheckbox('bib_select[]', $bib->getIdSite(), $coche + ['id' => 'bib_select_' . $bib->getId()]). + $this->formCheckbox('bib_select[]', + $bib->getIdSite(), + $coche + ['id' => 'bib_select_' . $bib->getId()]) . $this->tag('span', $bib->getLibelle())); } $form_ul_ul = $this->tag('ul', $form_li_li); diff --git a/library/ZendAfi/Controller/Plugin/SelectionBib.php b/library/ZendAfi/Controller/Plugin/SelectionBib.php index 9cf1a8a0900c12d948aedb25fd7da732b0514730..09fcc813a64c19e5415586d2303b1923c58b0830 100644 --- a/library/ZendAfi/Controller/Plugin/SelectionBib.php +++ b/library/ZendAfi/Controller/Plugin/SelectionBib.php @@ -31,7 +31,6 @@ class ZendAfi_Controller_Plugin_SelectionBib extends Zend_Controller_Plugin_Abst if(!$params = $request->getParams()) return; - if(Class_Profil::hasChanged()) { unset($_SESSION['selection_bib']); $this->_session->id_bibs = []; @@ -107,9 +106,11 @@ class ZendAfi_Controller_Plugin_SelectionBib extends Zend_Controller_Plugin_Abst protected function setIdBibsParams($request) { - if(! $id_bibs = $request->getParam('bib_select')) + if (!$request->getParam('update_bib_select', false)) return; + $id_bibs = $request->getParam('bib_select', []); + if(!is_array($id_bibs)) $id_bibs = explode(',', $id_bibs); diff --git a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php index 00c591453278d46f998e0b957032282b215b4ea7..ab073a1c829e23cc69c21b631d5cfbcd6c4ee24a 100644 --- a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php +++ b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php @@ -78,11 +78,11 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base .$this->addMenu("moderation_16.png", $this->translate()->_("Modération"), "/admin/modo/", $this->filterAll($this->user), - $nb_moderations) + ['extra_infos' => $nb_moderations]) .$this->addMenu("demande_inscri_16.png", $this->translate()->_("Demandes d'inscription"), "/admin/modo/membreview", $this->filterAll($this->user), - $demandes_inscription) + ['extra_infos' => $demandes_inscription]) .$this->addMenu("lettres_16.png", $this->translate()->_("Lettres d'information"), "/admin/newsletter", $this->filterAdmin($this->user) || $this->user->hasRightToAccess(Class_UserGroup::RIGHT_USER_SITOTHEQUE)) @@ -237,7 +237,8 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base $this->openBoite($this->translate()->_("Système")) .$this->addMenu("database.png", $this->translate()->_("Accès à Cosmogramme"), Class_AdminVar::get("URL_COSMOGRAMME"), - $this->filterAdminPortail($this->user)) + $this->filterAdminPortail($this->user), + ['target' => '_blank']) .$this->addMenu("batch_16.png", $this->translate()->_("Batchs"), "/admin/batch", $this->filterAdminPortail($this->user)) @@ -266,7 +267,8 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base .$this->addMenu("file_browser.png", $this->translate()->_("Explorateur de fichiers"), 'http://' . $_SERVER['SERVER_NAME'].CKBASEURL."core_five_filemanager/index.html?ServerPath=".USERFILESURL, - $this->filterAdminPortail($this->user)) + $this->filterAdminPortail($this->user), + ['target' => '_blank']) .$this->addMenu('proprietes.gif', $this->translate()->_('Champs personnalisés'), @@ -334,26 +336,31 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base return($html); } - function addMenu($img,$titre,$lien, $access_allowed, $extra_infos='') { - if (!$access_allowed) return ''; + function addMenu($img, $titre, $lien, $access_allowed, $options=[]) { + if (!$access_allowed) + return ''; if(!preg_match('^http://^',$lien)) - $lien = BASE_URL.$lien; - - $ico = '<img src="'.URL_ADMIN_IMG.'picto/'.$img.'" alt="'.$titre.'" />'; - $url= ['START'=>'<a href="'.$lien.'">', - 'END'=>'</a>']; + $lien = BASE_URL . $lien; - $extra_infos = !empty($extra_infos) - ? "<span class='menu_info'>$extra_infos</span>" + $extra_infos = isset($options['extra_infos']) + ? $this->_tag('span', $options['extra_infos'], ['class' => 'menu_info']) : ''; - $class_selected = ''; - if (array_key_exists('REQUEST_URI', $_SERVER) - and false !== strpos($_SERVER['REQUEST_URI'], $lien)) { - $class_selected = 'class="selected"'; - } + $attributes = (array_key_exists('REQUEST_URI', $_SERVER) + && false !== strpos($_SERVER['REQUEST_URI'], $lien)) + ? ['class' => 'selected'] + : []; + + $anchor_params = ['href' => $lien]; + if (isset($options['target'])) + $anchor_params['target'] = $options['target']; + + $ico = $this->_tag('img', null, + ['src' => URL_ADMIN_IMG . 'picto/' . $img, + 'alt' => $titre]); - $html = '<li '.$class_selected.'>'.$ico.$url["START"].$titre.$url["END"].$extra_infos.'</li>'; - return ($html); + return $this->_tag('li', + $ico . $this->_tag('a', $titre, $anchor_params) . $extra_infos, + $attributes); } } diff --git a/library/ZendAfi/View/Helper/TagRechercheSimple.php b/library/ZendAfi/View/Helper/TagRechercheSimple.php index fa8ffa953b19430bc95a2d65c0567fe96f78c1b9..20eaa3e716a761f2958501f67ab089e7a4a45a9e 100644 --- a/library/ZendAfi/View/Helper/TagRechercheSimple.php +++ b/library/ZendAfi/View/Helper/TagRechercheSimple.php @@ -109,7 +109,7 @@ class ZendAfi_View_Helper_TagRechercheSimple extends Zend_View_Helper_HtmlElemen $bibs_labels = []; foreach($bib_ids as $id) - $bibs_labels[] = Class_Bib::find($id)->getLibelle(); + $bibs_labels[] = ($bib = Class_Bib::find((int)$id)) ? $bib->getLibelle() : ''; return $message .= $this->view->tag('span', $this->view->_plural(count($bibs_labels), 'Aucune bib de sélectionnée.', diff --git a/library/startup.php b/library/startup.php index 83b6cbc10a65528bc3277c659a89af90b5ebdc6d..dc0a3ece8eb39773d939376c81789bd504fc8b2b 100644 --- a/library/startup.php +++ b/library/startup.php @@ -64,7 +64,7 @@ function defineConstant($name, $value) { function setupConstants() { defineConstant('BOKEH_MAJOR_VERSION','7.3'); - defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.16'); + defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.17'); defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/'); diff --git a/public/admin/js/onload_utils.js b/public/admin/js/onload_utils.js index 5c6cd20804990d53354889b3ba04a36f112f2411..f66137c3f2eb91773611003955b700c616a5a1f7 100644 --- a/public/admin/js/onload_utils.js +++ b/public/admin/js/onload_utils.js @@ -52,15 +52,13 @@ var setupAnchorsTarget = function() { $('a[href^="http"]').each(function() { if (!internalLink.test($(this).attr('href')) && (undefined == this.onclick) - && (undefined == $(this).data('events') || undefined == $(this).data('events').click) // jquery < 1.8 - && (undefined == $._data(this, 'events') || undefined == $._data(this, 'events').click) // jquery >= 1.8 - ) { + && (undefined == $(this).data('events') || undefined == $(this).data('events').click)) { if ($.browser.msie || !!navigator.userAgent.match(/Trident/)) { // Otherwise IE doesn't send HTTP Referer this.target = '_blank'; return; } - + $(this).click(function(event) { event.preventDefault(); event.stopPropagation(); diff --git a/public/opac/js/recherche.js b/public/opac/js/recherche.js index 128533e4de92662f197ce86c037edd0d127ad55a..3ac0d4bc74f928834c5c7fb2b2cb092fa877d08c 100644 --- a/public/opac/js/recherche.js +++ b/public/opac/js/recherche.js @@ -145,7 +145,8 @@ function localisationExemplaire(localization_img, id_bib, sCote, sCodeBarres) { return; } - if(data.url == null) { + if(data.url == null || data.url == '') { + restore_localization_img(); localisationBulle(data.titre, data.description, data.photo); return; } diff --git a/tests/application/modules/opac/controllers/BibControllerTest.php b/tests/application/modules/opac/controllers/BibControllerTest.php index 4d41bb37438635f0da663a35523a3404cd2f390e..8d62fa98f2e0d2572123842d6258381eeb94e68e 100644 --- a/tests/application/modules/opac/controllers/BibControllerTest.php +++ b/tests/application/modules/opac/controllers/BibControllerTest.php @@ -481,13 +481,12 @@ class BibControllerBibSelectionWithBibsIdsInSessionTest extends BibControllerSel - class BibControllerBibSelectionPostDispatchTest extends BibControllerSelectionTestCase { public function setUp() { parent::setUp(); $_SERVER['HTTP_REFERER'] = 'http://mybokeh.org/recherche/simple/expressionRecherche/pomme/bib_select/2'; - $this->postDispatch('bib/selection', ['bib_select' => [1, 2]]); + $this->postDispatch('bib/selection', ['update_bib_select' => 1, 'bib_select' => [1, 2]]); } /** @test */ @@ -497,24 +496,29 @@ class BibControllerBibSelectionPostDispatchTest extends BibControllerSelectionTe /** @test */ - public function seesionShouldContainsCasablancaAndCairo() { + public function sessionShouldContainsCasablancaAndCairo() { $this->assertEquals([1, 2] , $this->_session->id_bibs); } } -class BibControllerBibSelectionPostDispatchWithoutRechercheControllerInRefererTest extends BibControllerSelectionTestCase { +class BibControllerBibSelectionUnselectPostDispatch extends BibControllerSelectionTestCase { public function setUp() { parent::setUp(); - $_SERVER['HTTP_REFERER'] = 'http://mybokeh.org'; + $_SERVER['HTTP_REFERER'] = 'http://mybokeh.org/recherche/simple/expressionRecherche/pomme/bib_select/2'; - $this->postDispatch('bib/selection', ['bib_select' => [1, 2]]); + $this->postDispatch('bib/selection', ['update_bib_select' => 1]); } /** @test */ - public function shouldRedirectToRefererWithNewParams() { - $this->assertRedirectTo('http://mybokeh.org'); + public function shouldRedirectToRefererWithNoNewParams() { + $this->assertRedirectTo('/recherche/simple/expressionRecherche/pomme'); + } + + /** @test */ + public function sessionShouldNotContainsCasablancaAndCairo() { + $this->assertEquals([] , $this->_session->id_bibs); } } diff --git a/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php b/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php index f80850fa2a5696ee845df417e7b58d861b459a8f..5a5a2eb0b17b9abbdfaddef7a3973254be3288d5 100644 --- a/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php +++ b/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php @@ -30,6 +30,7 @@ abstract class ZendAfi_View_Helper_Admin_MenuGaucheAdminVariableBibnumDisabledTe Class_AdminVar::newInstanceWithId('BIBNUM', ['valeur' => 0]); $this->helper = new ZendAfi_View_Helper_Admin_MenuGaucheAdmin(); + $this->helper->setView($this->view); } } @@ -107,18 +108,29 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdminVariableAsAdminTest extends ZendA $this->assertXPath($this->html, '//a[contains(@href, "/admin/harvest/orphea-browse")]'); } + /** @test */ public function menuGaucheAdminShouldContainsJamendo() { $this->assertXPath($this->html, '//a[contains(@href, "/admin/harvest/jamendo-browse")]'); - } - /** @test */ public function menuGaucheAdminShouldContainsFusionTemplatesForPrint() { $this->assertXPath($this->html, '//a[contains(@href, "/admin/print/index")]'); } + + + /** @test */ + public function fileExplorerShouldHaveTargetBlank() { + $this->assertXPath($this->html, '//a[contains(@href, "/ckeditor/core_five_filemanager")][@target="_blank"]'); + } + + + /** @test */ + public function cosmogrammeAccessShouldHaveTargetBlank() { + $this->assertXPathContentContains($this->html, '//a[@target="_blank"]', utf8_encode('Accès à Cosmogramme')); + } }