diff --git a/VERSIONS_HOTLINE/118968 b/VERSIONS_HOTLINE/118968 new file mode 100644 index 0000000000000000000000000000000000000000..740557cc274affcd12431804873515a8cbce5e39 --- /dev/null +++ b/VERSIONS_HOTLINE/118968 @@ -0,0 +1 @@ + - ticket #118968 : Indexation des albums : le champ 330$a de la notice générée conserve le HTML de la description \ No newline at end of file diff --git a/VERSIONS_HOTLINE/122044 b/VERSIONS_HOTLINE/122044 new file mode 100644 index 0000000000000000000000000000000000000000..2cc0a3f1e82e1543523d08f90888b6cb2a5fd76c --- /dev/null +++ b/VERSIONS_HOTLINE/122044 @@ -0,0 +1 @@ + - ticket #122044 : Cosmogramme / écran variables : réintroduction de la description des variables qui avait disparu suite à la refonte de l'écran \ No newline at end of file diff --git a/VERSIONS_HOTLINE/122077 b/VERSIONS_HOTLINE/122077 new file mode 100644 index 0000000000000000000000000000000000000000..29817801451620473b6c83305ff4b50c51417a9e --- /dev/null +++ b/VERSIONS_HOTLINE/122077 @@ -0,0 +1 @@ + - ticket #122077 : Drive : ajout de la variable DRIVE_ALLOW_CHECKOUT_TODAY qui permet d'autoriser la prise de rendez-vous le jour même \ No newline at end of file diff --git a/VERSIONS_HOTLINE/122287 b/VERSIONS_HOTLINE/122287 new file mode 100644 index 0000000000000000000000000000000000000000..ecf0cdc546d1e915a5b6b84ff0b3af1e5e937866 --- /dev/null +++ b/VERSIONS_HOTLINE/122287 @@ -0,0 +1 @@ + - ticket #122287 : [GPSEA P2] comportement barre de recherche lors du Scroll \ No newline at end of file diff --git a/VERSIONS_WIP/121942 b/VERSIONS_WIP/121942 new file mode 100644 index 0000000000000000000000000000000000000000..67e25dbeba49f034023c4ab538ca49de472cb207 --- /dev/null +++ b/VERSIONS_WIP/121942 @@ -0,0 +1 @@ + - ticket #121942 : Réservation : Possibilité d'insérer un message html lors de l'affichage de la liste des sites de retrait \ No newline at end of file diff --git a/application/modules/opac/controllers/RechercheController.php b/application/modules/opac/controllers/RechercheController.php index 6cef217d4d35f99fad61541104856aa9181eac5d..a7a39eea6742561aca07f15fbf5dd73618105063 100644 --- a/application/modules/opac/controllers/RechercheController.php +++ b/application/modules/opac/controllers/RechercheController.php @@ -900,15 +900,18 @@ class RechercheController extends ZendAfi_Controller_Action { 'code_annexe' => $this->_request->getPost('code_annexe')])); } + $html = []; + if ($message = trim(Class_AdminVar::getValueOrDefault('HOLD_SITE_SELECTION_CUSTOM_MESSAGE'))) + $html [] = $this->view->div(['class' => 'hold_site_selection_message'], $message); - $html = empty($radio->getMultiOptions()) - ? $this->view->tag('p', - $this->_('Aucun site de retrait disponible'), - ['class' => 'error']) - : $this->view->renderForm($form); + $html [] = (empty($radio->getMultiOptions()) + ? $this->view->tag('p', + $this->_('Aucun site de retrait disponible'), + ['class' => 'error']) + : $this->view->renderForm($form)); $this->renderPopupResult($this->view->_('Lieu de mise à disposition demandé'), - $html); + implode('',$html)); } diff --git a/cosmogramme/VERSIONS_HOTLINE/108289 b/cosmogramme/VERSIONS_HOTLINE/108289 new file mode 100644 index 0000000000000000000000000000000000000000..5bd32c6dc3e6ec054e215b291aab33a8103b16ac --- /dev/null +++ b/cosmogramme/VERSIONS_HOTLINE/108289 @@ -0,0 +1 @@ + - ticket #108289 : Correction de l'indexation full text des mots du genres qui pouvaient être concaténés \ No newline at end of file diff --git a/cosmogramme/cosmozend/tests/CosmoControllerTestCase.php b/cosmogramme/cosmozend/tests/CosmoControllerTestCase.php index fbafde6c40e779d1efd6f06060463216fa3477e3..687636992be53e707438c9819504f00fd8c17dc7 100644 --- a/cosmogramme/cosmozend/tests/CosmoControllerTestCase.php +++ b/cosmogramme/cosmozend/tests/CosmoControllerTestCase.php @@ -33,6 +33,8 @@ abstract class CosmoControllerTestCase extends Zend_Test_PHPUnit_ControllerTestC Storm_Model_Abstract::unsetLoaders(); Storm_Cache::setDefaultZendCache(null); Class_AdminVar::set('NOM_DOMAINE', 'http://localhost'); + Zend_Registry::get('locale')->setLocale('fr'); + Zend_Registry::get('translate')->setLocale('fr'); if ($this->_storm_default_to_volatile) Storm_Model_Loader::defaultToVolatile(); diff --git a/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/VariableTest.php b/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/VariableTest.php index 9bb34ed436ba3f0f332aa71418423ed3016757d7..ea472b9f9e602cc6fc782947a3a85a58668e1a87 100644 --- a/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/VariableTest.php +++ b/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/VariableTest.php @@ -21,7 +21,6 @@ class Cosmo_VariableIndexTest extends CosmoControllerTestCase { - public function setUp() { parent::setUp(); Class_CosmoVar::newInstance(['clef' => 'oui_non', @@ -41,6 +40,7 @@ class Cosmo_VariableIndexTest extends CosmoControllerTestCase { Class_CosmoVar::newInstance(['clef' => 'log_path', 'valeur' => '/path/to/log', + 'commentaire' => 'path to logs', 'groupe' => 1, 'ordre' => 1, 'hidden' => 0]) @@ -99,7 +99,13 @@ class Cosmo_VariableIndexTest extends CosmoControllerTestCase { /** @test */ public function firstElementShouldBeLogPath() { - $this->assertXPathContentContains('//table[@id="variables"]//tr[1]', 'log_path', $this->_response->getBody()); + $this->assertXPathContentContains('//table[@id="variables"]//tr[1]', 'log_path'); + } + + + /** @test */ + public function firstElementLogPathShouldHaveColumnWithCommentPathToLogs() { + $this->assertXPathContentContains('//table[@id="variables"]//tr[1]', 'path to logs'); } diff --git a/cosmogramme/php/classes/classe_notice_integration.php b/cosmogramme/php/classes/classe_notice_integration.php index 008a83dabf840171ac477d1306fda1013ddd58f5..e350082240cbf46ae998f4c63b787aeddeda7e30 100644 --- a/cosmogramme/php/classes/classe_notice_integration.php +++ b/cosmogramme/php/classes/classe_notice_integration.php @@ -960,7 +960,7 @@ class notice_integration { { $facettes[]= Class_CodifGenre::CODE_FACETTE . $genre; if ($codif_genre = Class_CodifGenre::find($genre)) - $this->notice["full_dewey"].=$codif_genre->getLibelle(); + $this->notice["full_dewey"] .= ' ' . $codif_genre->getLibelle(); } } diff --git a/cosmogramme/tests/php/classes/NanookRecordsIntegrationTest.php b/cosmogramme/tests/php/classes/NanookRecordsIntegrationTest.php index c16b3a59c0c83a5e02cf490c3fc9eee810b2cd94..a043852ed8b0e5c3866759c580bd9d46765e6ca7 100644 --- a/cosmogramme/tests/php/classes/NanookRecordsIntegrationTest.php +++ b/cosmogramme/tests/php/classes/NanookRecordsIntegrationTest.php @@ -377,7 +377,7 @@ class NanookRecordsIntegrationOblivionTest extends NanookRecordsIntegrationTestC $this->fixture('Class_CodifGenre', ['id' => 96, - 'libelle' => 'Film', + 'libelle' => 'Film Fantastique', 'regles' => '995$7=15']); $this->loadNotice('unimarc_oblivion'); @@ -418,7 +418,14 @@ class NanookRecordsIntegrationOblivionTest extends NanookRecordsIntegrationTestC /** @test */ public function genreShouldBeFilm() { $genre = $this->_notice->getGenres()[0]; - $this->assertEquals('Film', $genre->getLibelle()); + $this->assertEquals('Film Fantastique', $genre->getLibelle()); + } + + + /** @test */ + public function deweyShouldBeIndexedWithFilmFantastique() { + $this->assertEquals('FANTASTIQUE FANTASTIK FANTASY FANTASI ACTION AKSION FILM', + $this->_notice->getDewey()); } diff --git a/library/Class/AdminVar.php b/library/Class/AdminVar.php index 883de304379c4ea71b9bfe11c2ae7453de1cc3c2..f7c7e831a67a9a8bacfa8335836627a09cf983a0 100644 --- a/library/Class/AdminVar.php +++ b/library/Class/AdminVar.php @@ -373,6 +373,7 @@ class Class_AdminVarLoader extends Storm_Model_Loader { 'NB_AFFICH_AVIS_PAR_AUTEUR' => Class_AdminVar_Meta::newDefault($this->_('Nombre d\'avis maximum à afficher par utilisateur.')), 'REGISTER_OK' => Class_AdminVar_Meta::newEncodedData($this->_('Texte visible par l\'internaute après son inscription.')), 'RESA_CONDITION' => Class_AdminVar_Meta::newEncodedData($this->_('Texte visible après l\'envoi d\'e-mail de demande de réservation.')), + 'HOLD_SITE_SELECTION_CUSTOM_MESSAGE' => Class_AdminVar_Meta::newEditor($this->_('Réservation : Texte à insérer lors de l\'affichage des sites de retraits'), ['value' => '']), 'SITE_OK' => Class_AdminVar_Meta::newOnOff($this->_('Désactiver pour passer le site en maintenance')), 'ID_BIBLIOSURF' => Class_AdminVar_Meta::newDefault($this->_('Nom de la bibliothèque chez bibliosurf (en minuscules)'))->bePrivate(), 'ID_READ_SPEAKER' => Class_AdminVar_Meta::newDefault($this->_('Numéro de client Read Speaker <a target="_blank" href="http://webreader.readspeaker.com">http://webreader.readspeaker.com</a>')), @@ -416,7 +417,6 @@ class Class_AdminVarLoader extends Storm_Model_Loader { 'ENABLE_COLLABORATIVE_BROWSING' => Class_AdminVar_Meta::newOnOff($this->_('Activation de la navigation collaborative')), 'KOHA_MULTI_SITES' => Class_AdminVar_Meta::newOnOff($this->_('WS KOHA : Réservation d\'exemplaires pour les multi sites à l\'exemplaire. (Uniquement "HoldItem")')), 'KOHA_TRY_HOLD_ITEM' => Class_AdminVar_Meta::newOnOff($this->_('WS KOHA : Tentative de réservation à l\'exemplaires puis à la notice. ("HoldItem" puis "HoldTitle")')), - 'TEXT_REPLACEMENTS' => Class_AdminVar_Meta::newRawText($this->_('Remplacement de textes à la volée. <br/>Ex:<br/>Panier;Sélection<br/>Vous avez %%d paniers;Vous avez %%d sélections')), 'URL_COSMOGRAMME' => Class_AdminVar_Meta::newDefault('')->bePrivate(), 'PACK_MOBILE' => Class_AdminVar_Meta::newOnOff($this->_('Activation des fonctions avancées du téléphone'))->bePrivate(), @@ -566,6 +566,7 @@ class Class_AdminVarLoader extends Storm_Model_Loader { ['value'=> 'Suppression de votre rendez-vous à {library.libelle}']), 'DRIVE_TEMPLATE_DELETE_RDV_CONTENT' => Class_AdminVar_Meta::newEditor($this->_('Modèle utilisé pour les courriels de suppression de rendez-vous drive.'), ['value'=> '<p>Bonjour {user.nom_complet},</p> <p>nous vous confirmons la suppression de votre rendez-vous <strong> à {library.libelle} {rendez_vous.date_time_label}</strong>.</p>']), + 'DRIVE_ALLOW_CHECKOUT_TODAY' => Class_AdminVar_Meta::newOnOff($this->_('Autoriser la prise de rendez-vous le jour même')) ]; } diff --git a/library/Class/Bib/DriveOpening.php b/library/Class/Bib/DriveOpening.php index 6148fe01964445f8cd866756d210d74714ed3559..d5637f0f797c568bd1df4f38cc7ed4b5761ee9e2 100644 --- a/library/Class/Bib/DriveOpening.php +++ b/library/Class/Bib/DriveOpening.php @@ -34,7 +34,7 @@ class Class_Bib_DriveOpening { $dates = new Storm_Collection(); while ($start <= $end) { (new static($library, $start))->appendIfOpenTo($dates); - $start->modify('+1 day'); + $start->modify('+1 day midnight'); } return $dates; diff --git a/library/Class/Bib/DriveOpening/Period.php b/library/Class/Bib/DriveOpening/Period.php index 41df94a915a3023db9f2732919ae78129df0ab1f..2512dc23bf0f108d27f516e51a15d58cd11f3721 100644 --- a/library/Class/Bib/DriveOpening/Period.php +++ b/library/Class/Bib/DriveOpening/Period.php @@ -20,6 +20,8 @@ */ class Class_Bib_DriveOpening_Period { + use Trait_TimeSource; + const CHECKOUT_TIME_SLOT = '30'; @@ -63,7 +65,7 @@ class Class_Bib_DriveOpening_Period { public function isTimeAvailable($time) { - return ($quota = $this->quota()) + return ($time->getTimestamp() > $this->getCurrentTime()) && ($quota = $this->quota()) ? $quota > Class_DriveCheckout::countAtTimeForLibrary($time, $this->_library) : false; } diff --git a/library/Class/DriveCheckout/Plan.php b/library/Class/DriveCheckout/Plan.php index 5e0908b2144a06e4ad632a0d9e47a55164565369..55452089f0892c87f481f6b64ff84bc708121053 100644 --- a/library/Class/DriveCheckout/Plan.php +++ b/library/Class/DriveCheckout/Plan.php @@ -271,7 +271,10 @@ class Class_DriveCheckout_Plan { || !$library->hasDriveOuvertures()) return $this->_openings = new Storm_Collection(); - $start = $this->getTimeSource()->asDateTime()->modify('tomorrow'); + $start = (Class_AdminVar::isModuleEnabled('DRIVE_ALLOW_CHECKOUT_TODAY')) + ? $this->getTimeSourceAsDateTime()->modify('midnight') + : $this->getTimeSourceAsDateTime()->modify('tomorrow'); + $end = $this->_maxOpeningDateFor($library); return $this->_openings = Class_Bib_DriveOpening::allBetweenFor($start, $end, $library); @@ -281,7 +284,7 @@ class Class_DriveCheckout_Plan { protected function _maxOpeningDateFor($library) { return null !== ($max = $this->_getHolds()->maxAvailabilityEndDateIn($library)) ? $max - : $this->getTimeSource()->asDateTime()->modify('+2 weeks midnight'); + : $this->getTimeSourceAsDateTime()->modify('+2 weeks midnight'); } diff --git a/library/Class/Indexation/PseudoNotice.php b/library/Class/Indexation/PseudoNotice.php index 5ab9c99aea658b9d70234fa5c38f5f3219ec3d9c..00d5a07539a92885fee43452b51ea2ad61e948b9 100644 --- a/library/Class/Indexation/PseudoNotice.php +++ b/library/Class/Indexation/PseudoNotice.php @@ -410,7 +410,7 @@ class Class_Indexation_PseudoNotice_Album extends Class_Indexation_PseudoNotice{ if ($poster = $this->_model->getPoster()) $this->_datas['url_image'] = $poster; - $this->_datas['resume'] = strip_tags($this->_datas['description']); + $this->_datas['resume'] = $this->_datas['description']; $model = $this->_model; $this->_datas['notes'] = $model->getNotesForPseudoNotice(); diff --git a/library/Class/TableDescription/CosmoVar.php b/library/Class/TableDescription/CosmoVar.php index e7ef684b69e5d0e7b0a5a52ad0bb08a610352bcc..7258552b4ec9b113c80876cafdb40b0a18280ed8 100644 --- a/library/Class/TableDescription/CosmoVar.php +++ b/library/Class/TableDescription/CosmoVar.php @@ -33,6 +33,7 @@ class Class_TableDescription_CosmoVar extends Class_TableDescription { $model->acceptValueVisitor($this); return $this->_value; }) + ->addColumn($this->_('Description'), 'commentaire') ->addRowPluginsActions(); } diff --git a/library/templates/Chili/Assets/css/chili.css b/library/templates/Chili/Assets/css/chili.css index c735dafb4bdd5e7bc9839355df5a9fbdc6c4e544..e0e9b1ad7fa53e439c3597006005bf693b20aba6 100644 --- a/library/templates/Chili/Assets/css/chili.css +++ b/library/templates/Chili/Assets/css/chili.css @@ -596,6 +596,10 @@ footer { border-bottom: 2px solid var(--chili-red-bd) !important; } +.boite.menu.chili_fixed_top .navbar-collapse .navbar-collapse { + border-bottom: 1px solid var(--chili-red-bd) !important; +} + .chili_widget.nav .nav-link.active_item, .chili_widget.nav .nav-link.active_item * { color: var(--chili-red-t) !important; @@ -604,6 +608,7 @@ footer { .chili_widget.nav { left: 8.33333% !important; margin-left: 0 !important; + padding-right: 8.33333%; } .chili_widget.nav .nav-link { @@ -861,3 +866,81 @@ main .chili_widget { .bg-warning { background-color: var(--chili-white-bg) !important; } + +.widget.login .dropdown-menu { + width: 320px; +} + +.widget.login .dropdown-menu i + div { + margin-left: 15px; +} + +.widget.login .dropdown-menu i { + color: var(--chili-black-t); +} + +.widget.login .dropdown-menu .badge:before { + content: '('; +} + +.widget.login .dropdown-menu .badge:after { + content: ')'; +} + +.widget.login .dropdown-menu .badge { + color: var(--chili-red-t); + background-color: var(--chili-white-bg); +} + +.widget.login .dropdown-menu a[href*="auth/logout"] { + color: var(--chili-white-t) !important; + background-color: var(--chili-red-bd); + width: 250px; + display: block; + text-align: center; +} + +.widget.login .dropdown-menu h1 { + padding-top: 15px; +} + +.widget.login .dropdown-menu .nav-item { + padding: 5px 0; +} + + +.boite.menu.chili_fixed_top .navbar-toggler-icon { + background-image: unset; +} + +.boite.menu.chili_fixed_top .navbar-toggler-icon::after { + content: "\f002"; + font-family: "Font Awesome 5 Free"; + font-style: normal; + font-variant: normal; + text-rendering: auto; + line-height: 1; + font-weight: 900; + font-size: 34px; + color: var(--chili-red-t); +} + +.boite.menu.chili_fixed_top { + left: 58.33% !important; + padding-top: 0; +} + +.boite.menu.chili_fixed_top .navbar-collapse .navbar-collapse { + position: fixed; + padding: 20px 0; + width: 100%; + top: 65px; + height: 140px !important; + left: 0; + right: 0; + background-color: var(--chili-white-bg); +} + +.boite.menu.chili_fixed_top .navbar-collapse .navbar-collapse .dropdown-menu { + position: absolute; +} diff --git a/library/templates/Chili/Library/ProfilePatcher.php b/library/templates/Chili/Library/ProfilePatcher.php index 1823cb084c6a379b9ed5d13026284c5427f5b6d7..be5aa31f18b3f3e47110a4e3dfa439d5b676ae9d 100644 --- a/library/templates/Chili/Library/ProfilePatcher.php +++ b/library/templates/Chili/Library/ProfilePatcher.php @@ -24,6 +24,8 @@ class Chili_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher { protected $_main_menu, + $_search_menu, + $_login_menu, $_network_menu, $_legal_mentions_menu; @@ -144,6 +146,66 @@ class Chili_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher { ] ]); + $this->_search_menu = $this->_profile + ->addMenu(['libelle' => $this->_('Menu de recherche en scroll'), + 'picto' => '', + 'menus' => [ + ['type_menu' => 'MODULE_ACCUEIL_RECH_SIMPLE', + 'type_module' => 'RECH_SIMPLE', + 'libelle' => $this->_('Boites de recherche'), + + 'preferences' => ['titre' => $this->_('Recherche'), + 'boite' => ['no_border', 'no_border_radius', 'no_shadow', 'chili_widget', 'fond_rouge', 'align-item-center'], + 'search_button' => 'Rechercher', + 'placeholder' => $this->_('Recherchez un livre, un CD, un DVD, une musique...'), + 'doc_type_selection_label' => $this->_('Catégories'), + 'select_doc' => 1, + 'facets_in_session' => 1, + 'always_new_search' => 0, + 'type_doc' => '', + $this->_template->withNameSpace('form_style') => 'inline', + $this->_template->withNameSpace('width_xsmall') => 12, + $this->_template->withNameSpace('show_header') => 0, + $this->_template->withNameSpace('show_content') => 0, + $this->_template->withNameSpace('show_footer') => 0]], + + ]]); + + $this->_login_menu = $this->_profile + ->addMenu(['libelle' => $this->_('Boite de connexion'), + 'picto' => '', + 'menus' => [ + ['type_menu' => 'ABON_FICHE', + 'libelle' => $this->_('Mon compte'), + 'picto' => 'class fas fa-user-circle'], + + ['type_menu' => 'ABON_PRETS', + 'libelle' => $this->_('Mes prêts en cours'), + 'picto' => 'class fas fa-book', + 'display_counter' => '1'], + + ['type_menu' => 'ABON_RESAS', + 'libelle' => $this->_('Mes réservations en cours'), + 'picto' => 'class fas fa-thumbtack', + 'display_counter' => '1'], + + ['type_menu' => 'ABON_CARDS', + 'libelle' => $this->_('Mon abonnement'), + 'picto' => 'class fas fa-receipt', + 'display_end_validity' => '1'], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Découvrir notre site insitutionnel'), + 'url' => ''], + + ['type_menu' => 'DISCONNECT', + 'libelle' => $this->_('Se déconnecter')], + + ['type_menu' => 'FORM_CONTACT', + 'libelle' => $this->_('Un problème ? Contactez-nous !'), + 'url' => ''], + ]]); + $this->_network_menu = $this->_profile ->addMenu(['libelle' => $this->_('Le réseau'), 'picto' => '', @@ -221,7 +283,7 @@ class Chili_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher { ->_addWidget(Intonation_Library_Widget_Nav_Definition::CODE, Class_Profil::DIV_BANNIERE, ['titre' => $this->_('Navigation principal'), - 'boite' => ['no_border', 'no_border_radius', 'no_shadow', 'chili_widget', 'position_fixed_top', 'text-center', 'chili_fixed_top', 'w-100', 'order-1 order-lg-2'], + 'boite' => ['no_border', 'no_border_radius', 'no_shadow', 'chili_widget', 'position_fixed_top', 'text-center', 'chili_fixed_top', 'w-100', 'order-1', 'order-lg-2'], 'menu' => $this->_profile_id . '-' . $this->_main_menu, $this->_template->withNameSpace('expand_breakpoint') => Intonation_Library_Constants::RESPONSIVE_MODE_LARGE, $this->_template->withNameSpace('width_xsmall') => 9, @@ -229,6 +291,19 @@ class Chili_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher { $this->_template->withNameSpace('show_content') => 0, $this->_template->withNameSpace('show_footer') => 0]) + ->_addWidget(Intonation_Library_Widget_Menu_Definition::CODE, + Class_Profil::DIV_BANNIERE, + ['titre' => $this->_('Menu recherche'), + 'boite' => ['chili_fixed_top','no_border', 'no_border_radius', 'no_shadow', 'position_fixed_top'], + 'menu' => $this->_profile_id . '-' . $this->_search_menu, + 'layout' => 'horizontal', + $this->_template->withNameSpace('expand_breakpoint') => Intonation_Library_Constants::RESPONSIVE_MODE_ALWAYS, + $this->_template->withNameSpace('visible_when_hidden') => 6, + $this->_template->withNameSpace('width_xsmall') => 1, + $this->_template->withNameSpace('show_header') => 0, + $this->_template->withNameSpace('show_content') => 0, + $this->_template->withNameSpace('show_footer') => 0]) + ->_addWidget(Intonation_Library_Widget_Login_Definition::CODE, Class_Profil::DIV_BANNIERE, ['titre' => $this->_('Connexion'), diff --git a/library/templates/Chili/Library/Settings.php b/library/templates/Chili/Library/Settings.php index 9d95032007be55949ab86958529878dd410b22ab..7f36a97d9169be1c15cf5a905a287484c6a29450 100644 --- a/library/templates/Chili/Library/Settings.php +++ b/library/templates/Chili/Library/Settings.php @@ -33,7 +33,7 @@ class Chili_Library_Settings extends Intonation_Library_Settings { 'chili_banner', 'chili_logo', 'chili_logo_footer', - 'chili_fixid_top', + 'chili_fixed_top', 'chili_network_list_widget', 'fond_gris', 'fond_bleu', @@ -49,7 +49,8 @@ class Chili_Library_Settings extends Intonation_Library_Settings { 'order-2', 'my-3', 'py-3', - 'px-3']); + 'px-3', + 'w-100']); $settings[$this->_template->withNameSpace('custom_css_class')] = $custom_css_classes; diff --git a/library/templates/Intonation/Library/Widget/Search/View.php b/library/templates/Intonation/Library/Widget/Search/View.php index c2754d77a06f0be8328a362a5d0cc64b47f54872..25920440904484818d384f40ab7e4e9d311cbba3 100644 --- a/library/templates/Intonation/Library/Widget/Search/View.php +++ b/library/templates/Intonation/Library/Widget/Search/View.php @@ -276,7 +276,7 @@ abstract class IntonationSearchRenderAbstract { $label = $this->_settings->getDocTypeSelectionLabel(); $elements [] = $form->createElement('select', - 'custom_multifacets_doctype', + 'custom_multifacets_doctype_' . uniqid(), ['label' => $label, 'title' => $this->_('Filtrer le résultat de recherche par %s', strtolower($label)), diff --git a/library/templates/Intonation/View/RenderRecord/RenderItems.php b/library/templates/Intonation/View/RenderRecord/RenderItems.php index a3ac36560069b0725b84e6fe98d2d68c48d0b0fb..2c044ca33312fd4367745d21d30221f4e62bc156 100644 --- a/library/templates/Intonation/View/RenderRecord/RenderItems.php +++ b/library/templates/Intonation/View/RenderRecord/RenderItems.php @@ -33,6 +33,7 @@ class Intonation_View_RenderRecord_RenderItems extends ZendAfi_View_Helper_BaseH ->setModel($element); }); $html = []; + if ($map = $this->view->osmMap($elements)) $html [] = $this->view->div(['class' => 'col-12 mb-3 items_map'], $map); diff --git a/tests/library/Class/Indexation/PseudoNoticeTest.php b/tests/library/Class/Indexation/PseudoNoticeTest.php index 194ecea205c75f2a1a78180b4317a218975a1784..206c2fb5e8f3faa43bc89e461ff07d0367a1e662 100644 --- a/tests/library/Class/Indexation/PseudoNoticeTest.php +++ b/tests/library/Class/Indexation/PseudoNoticeTest.php @@ -523,6 +523,42 @@ class Class_Indexation_PseudoNoticeAlbumSummaryTest extends ModelTestCase { } + + +class Class_Indexation_PseudoNoticeAlbumSummaryWithHtmlTest + extends ModelTestCase { + protected $_storm_default_to_volatile = true; + + + public function setUp() { + parent::setUp(); + $this->fixture('Class_Album', + ['id'=> 42, + 'titre' => 'Sudoc', + 'description' => '<p>Aide : <a href="http://documentation.abes.fr/aidesudoc/FR/accueil/aidesudoc_index.html" target="_blank">http://documentation.abes.fr/aidesudoc/FR/accueil/aidesudoc_index.html</a></p>', + 'visible'=> true, + 'status' => Class_Album::STATUS_VALIDATED + ])->index(); + } + + + /** @test */ + public function noticeUnimarcSummaryShouldContainsAHref() { + $this->assertContains('<a href="http://documentation.abes.fr/aidesudoc/FR/accueil/aidesudoc_index.html"', + Class_Notice::find(1)->getResume()); + } + + + /** @test */ + public function noticeField330ShouldContainsAHref() { + $this->assertContains('<a href="http://documentation.abes.fr/aidesudoc/FR/accueil/aidesudoc_index.html"', + Class_Notice::find(1)->get_subfield('330', 'a')[0]); + } +} + + + + /** @see http://forge.afi-sa.fr/issues/72723 */ class Class_Indexation_PseudoNoticeArticleWithUnknownDomainTest extends ModelTestCase { diff --git a/tests/scenarios/DriveCheckOut/DriveCheckOutBookingTest.php b/tests/scenarios/DriveCheckOut/DriveCheckOutBookingTest.php index d1a6d5e1c34cbaad2e236a4b130d7c97b2d23984..c6254d4fa40e9e3478609cec6ff93822dd6b6084 100644 --- a/tests/scenarios/DriveCheckOut/DriveCheckOutBookingTest.php +++ b/tests/scenarios/DriveCheckOut/DriveCheckOutBookingTest.php @@ -58,9 +58,7 @@ abstract class DriveCheckOutBookingTestCase extends AbstractControllerTestCase { Class_AdminVar::set('ENABLE_DRIVE_CHECKOUT', 1); - $timesource = new TimeSourceForTest('2020-05-05 11:30'); - Class_DriveCheckout_Plan::setTimeSource($timesource); - Class_DriveCheckout::setTimeSource($timesource); + $this->_travelToTime('2020-05-05 11:30'); $this->_mail_transport = new MockMailTransport(); Zend_Mail::setDefaultTransport($this->_mail_transport); @@ -74,11 +72,20 @@ abstract class DriveCheckOutBookingTestCase extends AbstractControllerTestCase { public function tearDown() { Class_DriveCheckout_Plan::setTimeSource(null); Class_DriveCheckout::setTimeSource(null); + Class_Bib_DriveOpening_Period::setTimeSource(null); Class_Systeme_ModulesAccueil::reset(); parent::tearDown(); } + protected function _travelToTime($time) { + $timesource = new TimeSourceForTest($time); + Class_DriveCheckout_Plan::setTimeSource($timesource); + Class_DriveCheckout::setTimeSource($timesource); + Class_Bib_DriveOpening_Period::setTimeSource($timesource); + } + + protected function _setupProfile() { $this->_buildTemplateProfil(['id' => 23, 'mail_site' => 'zemail@mabib.st']); @@ -354,9 +361,7 @@ class DriveCheckOutBookingPlanOnBibWithDriveStartingNextWeekTest extends DriveCh ->setValidityStart('2020-11-17') ->beDrive()] ]); - $timesource = new TimeSourceForTest('2020-11-10 11:30'); - Class_DriveCheckout_Plan::setTimeSource($timesource); - Class_DriveCheckout::setTimeSource($timesource); + $this->_travelToTime('2020-11-10 11:30'); $this->dispatch('/opac/drive-checkout/plan/id_bib/5'); } @@ -630,6 +635,12 @@ class DriveCheckOutBookingPlanBibHotelDieuTest extends DriveCheckOutBookingTestC } + /** @test */ + public function pageShouldNotContainsLinkToChooseToday2020_05_05() { + $this->assertNotXPath('//a[contains(@href, "/checkout_date/2020-05-05")]'); + } + + /** @test */ public function pageShouldContainsLinkToChooseLastAvailabilityEndDate() { $this->assertXPath('//a[contains(@href, "/checkout_date/2020-05-13")]'); @@ -651,6 +662,29 @@ class DriveCheckOutBookingPlanBibHotelDieuTest extends DriveCheckOutBookingTestC +class DriveCheckOutBookingPlanBibHotelDieuAllowTodayTest extends DriveCheckOutBookingTestCase { + public function setUp() { + parent::setUp(); + Class_Adminvar::set('DRIVE_ALLOW_CHECKOUT_TODAY', 1); + $this->dispatch('/opac/drive-checkout/plan/id_bib/1'); + } + + + /** @test */ + public function pageShouldContainsLinkToChooseToday2020_05_05() { + $this->assertXPath('//a[contains(@href, "/checkout_date/2020-05-05")]'); + } + + + /** @test */ + public function pageShouldContainsLinkToChooseLastAvailabilityEndDate() { + $this->assertXPath('//a[contains(@href, "/checkout_date/2020-05-13")]'); + } +} + + + + class DriveCheckOutBookingPlanBibHotelDieuQuotaFullOn2020_05_12Test extends DriveCheckOutBookingTestCase { @@ -835,6 +869,50 @@ class DriveCheckOutBookingPlanBibHotelDieuAt2020_05_12QuotaFullAt09_00Test +class DriveCheckOutBookingPlanBibHotelDieuAtToday_Several_HoursTest + extends DriveCheckOutBookingTestCase { + + public function setUp() { + parent::setUp(); + Class_Adminvar::set('DRIVE_ALLOW_CHECKOUT_TODAY', 1); + } + + + /** @test */ + public function todayAt14_00From11_30ShouldBeSuccess() { + $this->_travelToTime('2020-05-05 11:30'); + + $this->postDispatch('/opac/drive-checkout/plan/id_bib/1/checkout_date/2020-05-05', + ['checkout_time' => '14:00']); + $this->assertFlashMessengerContentContains('Le retrait de vos documents de Hotel-Dieu est planifié pour le mardi 05 mai entre 14h00 et 14h30.'); + } + + + /** @test */ + public function todayAt14_00From15_00ShouldFail() { + $this->_travelToTime('2020-05-05 15:00'); + + $this->postDispatch('/opac/drive-checkout/plan/id_bib/1/checkout_date/2020-05-05', + ['checkout_time' => '14:00']); + + $this->assertFlashMessengerContentContains('est pas disponible'); + } + + + /** @test */ + public function todayAt16_00From15_00ShouldBeSuccess() { + $this->_travelToTime('2020-05-05 15:00'); + + $this->postDispatch('/opac/drive-checkout/plan/id_bib/1/checkout_date/2020-05-05', + ['checkout_time' => '16:00']); + + $this->assertFlashMessengerContentContains('entre 16h00 et 16h30'); + } +} + + + + class DriveCheckOutBookingPlanBibHotelDieuAt2020_05_12_09_00Test extends DriveCheckOutBookingTestCase { protected $_mail; diff --git a/tests/scenarios/DriveCheckOut/DriveCheckoutAdminControllerTest.php b/tests/scenarios/DriveCheckOut/DriveCheckoutAdminControllerTest.php index bf19c826e813c03f01b4b608a73df00d637f8e33..5d182ad5337a8cd8b3ca0b466df6aeac55ae06a3 100644 --- a/tests/scenarios/DriveCheckOut/DriveCheckoutAdminControllerTest.php +++ b/tests/scenarios/DriveCheckOut/DriveCheckoutAdminControllerTest.php @@ -33,6 +33,7 @@ abstract class DriveCheckOutAdminControllerTestCase extends Admin_AbstractContro $timesource = new TimeSourceForTest('2020-05-12 10:00:00'); Admin_DriveCheckoutController::setTimeSource($timesource); Class_DriveCheckout_Plan::setTimeSource($timesource); + Class_Bib_DriveOpening_Period::setTimeSource($timesource); Class_AdminVar::set('ENABLE_DRIVE_CHECKOUT', 1); @@ -169,6 +170,14 @@ abstract class DriveCheckOutAdminControllerTestCase extends Admin_AbstractContro 'start_at' => '2020-05-15 10:00:00', 'created_at' => '0000-00-00 00:00:00']); } + + + public function tearDown() { + Admin_DriveCheckoutController::setTimeSource(null); + Class_DriveCheckout_Plan::setTimeSource(null); + Class_Bib_DriveOpening_Period::setTimeSource(null); + parent::tearDown(); + } } diff --git a/tests/scenarios/Templates/ChiliTest.php b/tests/scenarios/Templates/ChiliTest.php index f3ccfb93ed2edc76f4d8a4e50eebae255bd9f07e..4a1455746540a5ddf1556c9efe454f844cf91b22 100644 --- a/tests/scenarios/Templates/ChiliTest.php +++ b/tests/scenarios/Templates/ChiliTest.php @@ -502,6 +502,17 @@ class ChiliTemplateNotLoggedTest extends ChiliTemplateTestCase { $this->assertXPath('//form/input[@id="login"][@class= "zendafi_form_login_login btn btn-sm btn-primary order-3 my-3"]', $this->_response->getBody()); } + + /** @test */ + public function searchWidgetShouldBeInMenu() { + $this->assertXPath('//header//div[contains(@class, "boite menu")][contains(@class, "d-none")]//div[contains(@class, "navbar-collapse")]//div[contains(@class, "boite rech_simple")][contains(@class, "chili_widget")]'); + } + + + /** @test */ + public function menuSearchShouldBeVisibleWhenSearchIsHidden() { + $this->assertXPathContentContains('//script', '$("#boite_3").visible_when_hidden("#boite_6")'); + } } diff --git a/tests/scenarios/Templates/TemplatesSearchTest.php b/tests/scenarios/Templates/TemplatesSearchTest.php index dc99cd076062f011dcf10eb6a05024eb3ba52c8e..2a6eebdeddd682deca90155505c3191efc5dd332 100644 --- a/tests/scenarios/Templates/TemplatesSearchTest.php +++ b/tests/scenarios/Templates/TemplatesSearchTest.php @@ -148,7 +148,7 @@ class TemplatesPostDispatchSearchWithCustomMultifactesTest extends AbstractContr parent::setUp(); $this->postDispatch('/opac/recherche/simple/', ['custom_multifacets_annexe' => 'A1', 'custom_multifacets_domains' => 'D1', - 'custom_multifacets_doctype' => ['T1','T2']]); + 'custom_multifacets_doctype_IUE342RRST' => ['T1','T2']]); } /** @test */ @@ -504,6 +504,55 @@ class TemplatesSearchReservationPickupAjaxTest extends TemplatesSearchWithItemsL public function loginFormShouldNotBeDropdown() { $this->_xpath->assertNotXPath($this->_html, '//div[@class="dropdown"]'); } + } -?> \ No newline at end of file + + + +class TemplatesSearchReservationPickupAjaxConnectedUserTest extends TemplatesSearchWithItemsLinkToSIGBTestCase { + protected + $_html, + $_xpath; + + public function setUp() { + parent::setUp(); + $user = $this->fixture('Class_Users', + ['id' => 8989, + 'login' => ',eui', + 'password' => 'ier']); + Class_CosmoVar::setValueOf('site_retrait_resa', + Class_CosmoVar::PICKUP_LOCATION_CHOICE); + + ZendAfi_Auth::getInstance()->logUser($user); + Class_Profil::find(1) + ->setBoiteOfTypeInDivision(4, + Intonation_Library_Widget_Login_Definition::CODE, + ['tri' => Class_CriteresRecherche::SORT_NOVELTY_DESC, + 'IntonationFormStyle' => 'toggle']) + ->assertSave(); + $this->fixture('Class_CodifAnnexe', + ['id' => 3, + 'code' => '37', + 'id_origine' => '37', + 'libelle' => 'Cran']); + + Class_AdminVar::set('HOLD_SITE_SELECTION_CUSTOM_MESSAGE', '<b>This is an additional text message</b>')->save(); + $this->dispatch('/recherche/reservation-pickup-ajax/id/34/id_notice/34/id_int_bib/2/id_bib/23'); + + $this->_xpath = new Storm_Test_XPath(); + $this->_html = json_decode($this->_response->getBody(), true)['content']; + } + + + /** @test */ + public function CranShouldBeSelectable() { + $this->_xpath->assertXPath($this->_html, '//input[@type="radio"][@value=37]',$this->_html); + } + + + /** @test */ + public function holdMessageShouldBeDisplayedIfDefined() { + $this->_xpath->assertXPathContentContains($this->_html,'//div[contains(@class, "hold_site_selection_message")]','<b>This is an additional text message</b>'); + } +}