From 4c9871db010e94eecba59c103651db075ce3ed76 Mon Sep 17 00:00:00 2001 From: Laurent Laffont <llaffont@afi-sa.fr> Date: Mon, 9 Sep 2019 10:37:59 +0200 Subject: [PATCH] dev #86039 bundled holds : functional testing fix --- FEATURES/86039 | 10 +++++----- VERSIONS_WIP/86039 | 2 +- .../opac/controllers/RechercheController.php | 15 +++++++++++---- .../Controller/Plugin/InspectorGadget.php | 2 +- library/ZendAfi/Form/Cosmo/DataProfile.php | 2 +- public/opac/css/global.css | 18 ++++++++++++++++-- tests/library/Class/CommSigbTest.php | 2 +- 7 files changed, 36 insertions(+), 15 deletions(-) diff --git a/FEATURES/86039 b/FEATURES/86039 index f65d1a6066a..5cc5f2a560f 100644 --- a/FEATURES/86039 +++ b/FEATURES/86039 @@ -1,10 +1,10 @@ '86039' => - ['Label' => $this->_('PAIRING [Contractuel] BDP89 Specs prêt malle'), - 'Desc' => '', + ['Label' => $this->_('SIGB Koha : réservation calendaire de lots d\'exemplaires'), + 'Desc' => $this->_('Vous pouvez configurer Bokeh pour utiliser un autre formulaire de réservation sur les exemplaires considérés comme des malles. Ce formulaire affichera les réservations déjà enregistrées, ainsi que la saisie de dates de début et de fin de prêt souhaitées'), 'Image' => '', - 'Video' => '', - 'Category' => '', + 'Video' => 'https://youtu.be/Wtg53t7dsGs', + 'Category' => $this->('Circulation'), 'Right' => function($feature_description, $user) {return true;}, - 'Wiki' => '', + 'Wiki' => 'http://wiki.bokeh-library-portal.org/index.php?title=R%C3%A9servation_calendaire_de_lots', 'Test' => '', 'Date' => '2019-07-26'], \ No newline at end of file diff --git a/VERSIONS_WIP/86039 b/VERSIONS_WIP/86039 index 1f3984c3076..c4d3786f598 100644 --- a/VERSIONS_WIP/86039 +++ b/VERSIONS_WIP/86039 @@ -1 +1 @@ - - ticket #86039 : PAIRING [Contractuel] BDP89 Specs prêt malle \ No newline at end of file + - ticket #86039 : SIGB Koha : ajout de la réservation calendaire de lots d'exemplaires (malles) \ No newline at end of file diff --git a/application/modules/opac/controllers/RechercheController.php b/application/modules/opac/controllers/RechercheController.php index a46ce6792f8..1b5d0343d82 100644 --- a/application/modules/opac/controllers/RechercheController.php +++ b/application/modules/opac/controllers/RechercheController.php @@ -774,15 +774,22 @@ class RechercheController extends ZendAfi_Controller_Action { Class_ScriptLoader::getInstance() ->addAdminScript('jquery_ui_datepicker_i18n/datepicker-fr.js') - ->addJQueryReady('$.datepicker.setDefaults($.datepicker.regional["' . ((Zend_Registry::get('locale') == 'en_US') ? '' : 'fr' ). '"]); + ->addJQueryReady(' + Date.prototype.withoutTime = function () { + var d = new Date(this); + d.setHours(0, 0, 0, 0); + return d; + } + $.datepicker.setDefaults($.datepicker.regional["' . ((Zend_Registry::get('locale') == 'en_US') ? '' : 'fr' ). '"]); $("input").blur(); $("#holds_view").datepicker( { - numberOfMonths: 4, + numberOfMonths: 3, beforeShowDay: function(date) { var holds = '. $js_holds . '; + var day = date.withoutTime(); var hold = holds.find( (hold) => { - return (new Date(hold[0]) <= date) && (new Date(hold[1]) >= date); + return (new Date(hold[0]).withoutTime() <= day) && (day <= new Date(hold[1]).withoutTime()); }); if (undefined == hold) @@ -792,7 +799,7 @@ class RechercheController extends ZendAfi_Controller_Action { }} );'); - return '<div id="holds_view"></div>' . $this->view->tag('div', $this->view->tag('ul',$html)); + return '<div id="holds_view"></div>' . $this->view->tag('ul',$html); } diff --git a/library/ZendAfi/Controller/Plugin/InspectorGadget.php b/library/ZendAfi/Controller/Plugin/InspectorGadget.php index 7f0c699ba42..77d9ec6b98d 100644 --- a/library/ZendAfi/Controller/Plugin/InspectorGadget.php +++ b/library/ZendAfi/Controller/Plugin/InspectorGadget.php @@ -68,7 +68,7 @@ class ZendAfi_Controller_Plugin_InspectorGadget extends Zend_Controller_Plugin_A if (!$this->isEnabled()) return $params; - $params[self::PARAM_NAME] = 1; + $params[self::PARAM_NAME] = $this->_keep ? 'keep' : 1; return $params; } diff --git a/library/ZendAfi/Form/Cosmo/DataProfile.php b/library/ZendAfi/Form/Cosmo/DataProfile.php index a015a4bd6c9..5ec6bdfcea0 100644 --- a/library/ZendAfi/Form/Cosmo/DataProfile.php +++ b/library/ZendAfi/Form/Cosmo/DataProfile.php @@ -226,7 +226,7 @@ class ZendAfi_Form_Cosmo_DataProfile extends ZendAfi_Form { 'champ_genre' => $this->_('genre'), 'champ_emplacement' => $this->_('emplacement'), 'champ_annexe' => $this->_('annexe'), - 'champ_availability' => $this->_('disponilité'), + 'champ_availability' => $this->_('disponibilité'), 'champ_bundle_id' => $this->_('identifiant de la notice de lot')]; return $this diff --git a/public/opac/css/global.css b/public/opac/css/global.css index 1acccdf79a1..68f09d0a805 100644 --- a/public/opac/css/global.css +++ b/public/opac/css/global.css @@ -3770,8 +3770,22 @@ a[href*="bookmarked-searches/notify"] img { } /** bundled holds dialog **/ +#holds_view .day-with-hold, +#holds_view .day-without-hold { + opacity: 1; +} + #holds_view .day-with-hold span { background-color: orange !important; } -#holds_view .day-without-hold span { background-color: green !important; } +#holds_view .day-without-hold span { background-color: #9bd99b !important; } + +#holds_view .ui-datepicker-inline.ui-widget-content { border-width: 0px } + +#holds_view .ui-datepicker-inline { + margin: 0 auto; +} -#holds_view .ui-datepicker-inline.ui-widget-content { border-width: 0px } \ No newline at end of file +#holds_view + ul { + justify-content: center; + display: flex; +} \ No newline at end of file diff --git a/tests/library/Class/CommSigbTest.php b/tests/library/Class/CommSigbTest.php index 143d51ae388..c838ebf3380 100644 --- a/tests/library/Class/CommSigbTest.php +++ b/tests/library/Class/CommSigbTest.php @@ -488,7 +488,7 @@ class CommSigbMeuseKohaTest extends CommSigbTestCase { /** @test */ - public function holdsForItemShouldCallHolsForItemOnKohaService() { + public function holdsForItemShouldCallHoldsForItemOnKohaService() { $item = $this->fixture('Class_Exemplaire', ['id' => '123', 'id_notice' => 7888, -- GitLab